From 960d5b8f2728f71dd9ce038d527844d82ca2f0f2 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 30 Apr 2026 09:16:03 +0200 Subject: Allow updates for existing contents --- lib/splay/tests/splay.t | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'lib/splay/tests') 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 - } + } -- cgit v1.2.3