Skip to content

Fix treap insert to correctly track size on duplicates#15

Merged
urschrei merged 1 commit intomainfrom
shugel/push-sqypwymtoyyu
Dec 6, 2025
Merged

Fix treap insert to correctly track size on duplicates#15
urschrei merged 1 commit intomainfrom
shugel/push-sqypwymtoyyu

Conversation

@urschrei
Copy link
Owner

@urschrei urschrei commented Dec 6, 2025

insert_node now returns (tree, was_inserted) tuple so that the size counter is only incremented when a new element is actually added. Previously, inserting a duplicate would incorrectly increment size.

insert_node now returns (tree, was_inserted) tuple so that the size
counter is only incremented when a new element is actually added.
Previously, inserting a duplicate would incorrectly increment size.
@urschrei urschrei merged commit 10080ac into main Dec 6, 2025
8 checks passed
@urschrei urschrei deleted the shugel/push-sqypwymtoyyu branch December 6, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant