Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Binary Search Tree

Language: Layout:
+ ] Show input
Compilation time: 0,14 sec, absolute running time: 0,09 sec, cpu time: 0,08 sec, average memory usage: 12 Mb, average nr of threads: 3 
edit mode |  history  | discussion
10
10
20
10
0
contains tests:
ASSERT: PASS: 10 exists
10
0
5
ASSERT: PASS: 4 does not exist
10
ASSERT: PASS: 20 exists
10
ASSERT: PASS: 0 exists
10
20
ASSERT: PASS: 100 does not exist
find min tests:
ASSERT: PASS: 0 is the minumim
find max tests:
ASSERT: FAIL: 20 is the maximum
level-order traversal - can be used for printing the tree:
10 0 20 5 15 

pre-order traversal
10 0 5 20 15 
in-order traversal - can be used for sorting the tree:
0 5 10 15 20 
post-order traversal
20 15 10 5 0