Commit 6665a1d20e6face11d266dc182b9c763f242c25d
1 parent
72fe14a7
ajout fonction manquante 2-4tree.anubis
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
anubis_dev/library/tools/2-4tree.anubis
| 1 | 1 | Author : Matthieu Herrmann |
| 2 | 2 | Creation : 2014/04/14 |
| 3 | - Last update : 2014/04/15 14:16 by matthieu@embryo (inserted by vim). | |
| 3 | + Last update : 2014/04/15 16:54 by matthieu@embryo (inserted by vim). | |
| 4 | 4 | ====================================================================================================================== |
| 5 | 5 | Library import: |
| 6 | 6 | read tools/iterators.anubis |
| ... | ... | @@ -139,6 +139,9 @@ type Tree($Entry): |
| 139 | 139 | empty(($Entry, $Entry) -> BTree24Compare compare), |
| 140 | 140 | tree(Node($Entry) root, ($Entry, $Entry) -> BTree24Compare compare). |
| 141 | 141 | |
| 142 | + Construction of a new tree: | |
| 143 | +public define Tree($Entry) new_tree( ($Entry, $Entry) -> BTree24Compare compare ) = empty(compare). | |
| 144 | + | |
| 142 | 145 | This type is used as the result of an insertion: when an entry is inserted in the tree, an other can be "rejected", |
| 143 | 146 | i.e. in a completed 4-leaf or 4-node. The rejected entry must be fused at the parent level, while "rewiding" the |
| 144 | 147 | recursive calls. |
| ... | ... | @@ -1144,7 +1147,7 @@ public define Iterator(($Key, $Value)) take_right(TreeKV($Key, $Value) tkv) = co |
| 1144 | 1147 | = Testing part ======================================================================================================= |
| 1145 | 1148 | ====================================================================================================================== |
| 1146 | 1149 | |
| 1147 | - | |
| 1150 | + read tools/basis.anubis | |
| 1148 | 1151 | |
| 1149 | 1152 | define One printTree(Node(Int) node) = if node is |
| 1150 | 1153 | { | ... | ... |