def test_keysInOrder_withNotEmptyTree_shouldReturnListOfKeysInOrder(self): bst = SplayTree() inputs = random.sample(range(1, 1000), 100) for i in inputs: bst.put(i, i) self.assertEqual(sorted(inputs), bst.keys_in_order())
def test_keysInOrder_withEmptyTree_shouldReturnEmptyList(self): bst = SplayTree() self.assertEqual([], bst.keys_in_order())