diff --git a/data_structures/binary_tree/treap.py b/data_structures/binary_tree/treap.py index 3114c6fa1c26..ca81d5967cb6 100644 --- a/data_structures/binary_tree/treap.py +++ b/data_structures/binary_tree/treap.py @@ -41,7 +41,7 @@ def split(root: Node | None, value: int) -> tuple[Node | None, Node | None]: """ if root is None or root.value is None: # None tree is split into 2 Nones return None, None - elif value < root.value: + elif value <= root.value: """ Right tree's root will be current node. Now we split(with the same value) current node's left son