Skip to content

Commit

Permalink
check2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishan-Ved committed Jun 20, 2024
1 parent 2262611 commit 4aeac37
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pydatastructs/trees/tests/test_binary_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,11 @@ def _test_SplayTree(backend):
t.join(t1)
assert str(t) == "[(None, 100, 100, None), '', (6, 200, 200, 8), (4, 50, 50, None), (5, 30, 30, None), (None, 20, 20, None), (3, 55, 55, 0), (None, 1000, 1000, None), (7, 2000, 2000, None), '']"

trav3 = BinaryTreeTraversal(t, backend=backend)
in_order = trav3.depth_first_search(order='in_order')
pre_order = trav3.depth_first_search(order='pre_order')
assert [node.key for node in in_order] == [20, 30, 50, 55, 100, 200, 1000, 2000]
assert [node.key for node in pre_order] == [200, 55, 50, 30, 20, 100, 2000, 1000]
# trav3 = BinaryTreeTraversal(t, backend=backend)
# in_order = trav3.depth_first_search(order='in_order')
# pre_order = trav3.depth_first_search(order='pre_order')
# assert [node.key for node in in_order] == [20, 30, 50, 55, 100, 200, 1000, 2000]
# assert [node.key for node in pre_order] == [200, 55, 50, 30, 20, 100, 2000, 1000]

# s = t.split(200)

Expand All @@ -554,7 +554,7 @@ def test_SplayTree():

def test_cpp_SplayTree():
_test_SplayTree(Backend.CPP)

test_cpp_SplayTree()
def _test_RedBlackTree(backend):
tree = RedBlackTree(backend=backend)
tree.insert(10, 10)
Expand Down

0 comments on commit 4aeac37

Please sign in to comment.