There was an error while loading. Please reload this page.
1 parent d031e8f commit 499d398Copy full SHA for 499d398
1 file changed
data_structures/binary_tree/treap.py
@@ -65,7 +65,7 @@ def merge(left: Node | None, right: Node | None) -> Node | None:
65
"""
66
if (not left) or (not right): # If one node is None, return the other
67
return left or right
68
- elif left.prior < right.prior:
+ elif left.prior > right.prior:
69
70
Left will be root because it has more priority
71
Now we need to merge left's right son and right tree
0 commit comments