Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishan-Ved committed Jul 2, 2024
1 parent cd7320a commit 0628176
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions pydatastructs/trees/tests/test_binary_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,37 +349,37 @@ def test_select_rank(expected_output):
assert output == expected_ranks

test_select_rank([2, 3, 5, 9, 10, 11, 12, 13, 15, 17, 18, 20, 30, 33])
# a5.delete(9)
# a5.delete(13)
# a5.delete(20)

# trav = BinaryTreeTraversal(a5, backend=backend)
# in_order = trav.depth_first_search(order='in_order')
# pre_order = trav.depth_first_search(order='pre_order')
# assert [node.key for node in in_order] == [2, 3, 5, 10, 11, 12, 15, 17, 18, 30, 33]
# assert [node.key for node in pre_order] == [17, 10, 3, 2, 5, 12, 11, 15, 30, 18, 33]

# test_select_rank([2, 3, 5, 10, 11, 12, 15, 17, 18, 30, 33])
# a5.delete(10)
# a5.delete(17)
# test_select_rank([2, 3, 5, 11, 12, 15, 18, 30, 33])
# a5.delete(11)
# a5.delete(30)
# test_select_rank([2, 3, 5, 12, 15, 18, 33])
# a5.delete(12)
# test_select_rank([2, 3, 5, 15, 18, 33])
# a5.delete(15)
# test_select_rank([2, 3, 5, 18, 33])
# a5.delete(18)
# test_select_rank([2, 3, 5, 33])
# a5.delete(33)
# test_select_rank([2, 3, 5])
# a5.delete(5)
# test_select_rank([2, 3])
# a5.delete(3)
# test_select_rank([2])
# a5.delete(2)
# test_select_rank([])
a5.delete(9)
a5.delete(13)
a5.delete(20)

trav = BinaryTreeTraversal(a5, backend=backend)
in_order = trav.depth_first_search(order='in_order')
pre_order = trav.depth_first_search(order='pre_order')
assert [node.key for node in in_order] == [2, 3, 5, 10, 11, 12, 15, 17, 18, 30, 33]
assert [node.key for node in pre_order] == [17, 10, 3, 2, 5, 12, 11, 15, 30, 18, 33]

test_select_rank([2, 3, 5, 10, 11, 12, 15, 17, 18, 30, 33])
a5.delete(10)
a5.delete(17)
test_select_rank([2, 3, 5, 11, 12, 15, 18, 30, 33])
a5.delete(11)
a5.delete(30)
test_select_rank([2, 3, 5, 12, 15, 18, 33])
a5.delete(12)
test_select_rank([2, 3, 5, 15, 18, 33])
a5.delete(15)
test_select_rank([2, 3, 5, 18, 33])
a5.delete(18)
test_select_rank([2, 3, 5, 33])
a5.delete(33)
test_select_rank([2, 3, 5])
a5.delete(5)
test_select_rank([2, 3])
a5.delete(3)
test_select_rank([2])
a5.delete(2)
test_select_rank([])

def test_AVLTree():
_test_AVLTree(backend=Backend.PYTHON)
Expand Down

0 comments on commit 0628176

Please sign in to comment.