Skip to content

Commit 35f09ce

Browse files
authored
Merge branch 'master' into fix-11871-fuzzy-union
2 parents d1fd58c + 4a766c6 commit 35f09ce

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎data_structures/binary_tree/treap.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def merge(left: Node | None, right: Node | None) -> Node | None:
6565
"""
6666
if (not left) or (not right): # If one node is None, return the other
6767
return left or right
68-
elif left.prior < right.prior:
68+
elif left.prior > right.prior:
6969
"""
7070
Left will be root because it has more priority
7171
Now we need to merge left's right son and right tree

‎data_structures/stacks/balanced_parentheses.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def balanced_parentheses(parentheses: str) -> bool:
1111
False
1212
>>> balanced_parentheses("1+2*3-4")
1313
True
14+
>>> balanced_parentheses("{}")
15+
True
16+
>>> balanced_parentheses("))((")
17+
False
18+
>>> balanced_parentheses("((")
19+
False
1420
>>> balanced_parentheses("")
1521
True
1622
"""

0 commit comments

Comments
 (0)