There was an error while loading. Please reload this page.
1 parent 78817c4 commit e9d86f1Copy full SHA for e9d86f1
1 file changed
data_structures/binary_tree/treap.py
@@ -101,8 +101,8 @@ def erase(root: Node | None, value: int) -> Node | None:
101
Split all nodes with values greater into right.
102
Merge left, right
103
"""
104
- left, right = split(root, value - 1)
105
- _, right = split(right, value)
+ left, right = split(root, value)
+ _, right = split(right, value + 1)
106
return merge(left, right)
107
108
0 commit comments