Ignore:
Timestamp:
Jan 20, 2021, 4:49:40 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
454f478
Parents:
92bfda0 (diff), fd54fef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/avltree/avl3.cfa

    r92bfda0 rdafbde8  
    44
    55// swaps the data within two tree nodes
    6 forall(otype K | Comparable(K), otype V)
     6forall(K | Comparable(K), V)
    77void node_swap(tree(K, V) * t, tree(K, V) * t2){
    88        swap( t->key,  t2->key);
     
    1111
    1212// go left as deep as possible from within the right subtree
    13 forall(otype K | Comparable(K), otype V)
     13forall(K | Comparable(K), V)
    1414tree(K, V) * find_successor(tree(K, V) * t){
    1515        tree(K, V) * find_successor_helper(tree(K, V) * t){
     
    2525
    2626// cleanup - don't want to deep delete, so set children to NULL first.
    27 forall(otype K | Comparable(K), otype V)
     27forall(K | Comparable(K), V)
    2828void deleteSingleNode(tree(K, V) * t) {
    2929        t->left = NULL;
     
    3333
    3434// does the actual remove operation once we've found the node in question
    35 forall(otype K | Comparable(K), otype V)
     35forall(K | Comparable(K), V)
    3636tree(K, V) * remove_node(tree(K, V) * t){
    3737        // is the node a leaf?
     
    8585
    8686// finds the node that needs to be removed
    87 forall(otype K | Comparable(K), otype V)
     87forall(K | Comparable(K), V)
    8888tree(K, V) * remove_helper(tree(K, V) * t, K key, int * worked){
    8989        if (empty(t)){
     
    106106}
    107107
    108 forall(otype K | Comparable(K), otype V)
     108forall(K | Comparable(K), V)
    109109int remove(tree(K, V) ** t, K key){
    110110        int worked = 0;
Note: See TracChangeset for help on using the changeset viewer.