Files
Python/data_structures
Maitri UpadhyayandChristian Clauss 3d11d0ca8a fix: correct treap split() comparison to match docstring behavior (#14762)
* fix: correct treap split() to match docstring for equal values (#7854)

The split() function in treap.py uses `<` comparison but the docstring states that the right subtree should contain values "greater or equal" to the split value. This fix changes `elif value < root.value:` to `elif value <= root.value:` so that equal values go to the right subtree as documented.

Fixes #7854

* Fix typo in Treap node docstringfix: remove accidental typo in Node class docstring

* Fix erase logic in treap.py

Adjust split logic to include the value in the right subtree.

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-11 07:07:16 +02:00
..
2025-10-08 14:11:28 +02:00
2026-09-08 17:57:46 +02:00