Changes in tests/avltree/avl3.cfa [fd54fef:107b01a]
- File:
-
- 1 edited
-
tests/avltree/avl3.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/avltree/avl3.cfa
rfd54fef r107b01a 4 4 5 5 // swaps the data within two tree nodes 6 forall( K | Comparable(K),V)6 forall(otype K | Comparable(K), otype V) 7 7 void node_swap(tree(K, V) * t, tree(K, V) * t2){ 8 8 swap( t->key, t2->key); … … 11 11 12 12 // go left as deep as possible from within the right subtree 13 forall( K | Comparable(K),V)13 forall(otype K | Comparable(K), otype V) 14 14 tree(K, V) * find_successor(tree(K, V) * t){ 15 15 tree(K, V) * find_successor_helper(tree(K, V) * t){ … … 25 25 26 26 // cleanup - don't want to deep delete, so set children to NULL first. 27 forall( K | Comparable(K),V)27 forall(otype K | Comparable(K), otype V) 28 28 void deleteSingleNode(tree(K, V) * t) { 29 29 t->left = NULL; … … 33 33 34 34 // does the actual remove operation once we've found the node in question 35 forall( K | Comparable(K),V)35 forall(otype K | Comparable(K), otype V) 36 36 tree(K, V) * remove_node(tree(K, V) * t){ 37 37 // is the node a leaf? … … 85 85 86 86 // finds the node that needs to be removed 87 forall( K | Comparable(K),V)87 forall(otype K | Comparable(K), otype V) 88 88 tree(K, V) * remove_helper(tree(K, V) * t, K key, int * worked){ 89 89 if (empty(t)){ … … 106 106 } 107 107 108 forall( K | Comparable(K),V)108 forall(otype K | Comparable(K), otype V) 109 109 int remove(tree(K, V) ** t, K key){ 110 110 int worked = 0;
Note:
See TracChangeset
for help on using the changeset viewer.