Binary Search Tree
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
|
|