Example #1
0
 def test_delete_multiple_avl(self, _, input_data, delete_data,
                              expected_result):
     avl = AvlTree.build_from_list(input_data)
     for key in delete_data:
         avl.delete_by_key(key)
     res = avl.iterative_inorder()
     assert expected_result == res
Example #2
0
 def test_delete_in_avl(self, _, input_data, key):
     avl = AvlTree.build_from_list(input_data)
     avl.delete_by_key(key)
     res = set(avl.iterative_inorder())
     assert key not in res
Example #3
0
 def test_build_avl(self, _, input_data, expected):
     avl = AvlTree.build_from_list(input_data)
     inorder = avl.iterative_inorder()
     assert inorder == expected