예제 #1
0
    def test_keysInOrder_withNotEmptyTree_shouldReturnListOfKeysInOrder(self):
        bst = Treap()
        inputs = random.sample(range(1, 1000), 100)

        for i in inputs:
            bst.put(i, i)

        self.assertEqual(sorted(inputs), bst.keys_in_order())
예제 #2
0
 def test_keysInOrder_withEmptyTree_shouldReturnEmptyList(self):
     bst = Treap()
     self.assertEqual([], bst.keys_in_order())