diff options
Diffstat (limited to 'lib/splay/tests')
| -rw-r--r-- | lib/splay/tests/splay.t | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/splay/tests/splay.t b/lib/splay/tests/splay.t index 64f77a6..7b49803 100644 --- a/lib/splay/tests/splay.t +++ b/lib/splay/tests/splay.t @@ -1,8 +1,18 @@ -Tests for the splay tree. The tree representation used in the tests follow the -dot syntax +Tests for the splay tree. See https://en.wikipedia.org/wiki/Splay_tree +The test build a splay tree with the node given as argument, then display the +representation using the dot syntax. + + $ tests --splay_tree \ + > --help + Start the tests + --add Add an element in the tree + --del Remove an element from the tree + --get Get an element from the tree + -help Display this list of options + --help Display this list of options The root is the latest inserted node: @@ -17,7 +27,7 @@ The root is the latest inserted node: "5" -> leaf_1 leaf_2 [shape=point] "5" -> leaf_2 - } + } $ tests --splay_tree \ > --add 3 \ @@ -30,7 +40,7 @@ The root is the latest inserted node: "3" -> leaf_1 leaf_2 [shape=point] "5" -> leaf_2 - } + } Collecting an element in the tree will push this node at the root: @@ -50,7 +60,7 @@ Collecting an element in the tree will push this node at the root: "3" -> leaf_2 leaf_3 [shape=point] "3" -> leaf_3 - } + } $ tests --splay_tree \ > --add 1 \ @@ -72,7 +82,7 @@ Collecting an element in the tree will push this node at the root: "4" -> leaf_3 leaf_4 [shape=point] "4" -> leaf_4 - } + } Removing an element from the tree modify the structure @@ -89,5 +99,5 @@ Removing an element from the tree modify the structure "3" -> leaf_1 leaf_2 [shape=point] "3" -> leaf_2 - } + } |
