Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RBT(fix): update size when removing final node; fixes #43 #45

Conversation

not-an-aardvark
Copy link
Contributor

The RedBlackTree.remove function usually updates the size of the tree, but it has an early exit for the case when a tree only has one node. Previously, the size was not getting updated in this case for mutable trees, so the tree would end up in an invalid state when is should be empty. This commit ensures that the size is correctly updated when removing the final node.

@not-an-aardvark
Copy link
Contributor Author

Looks like this is fixed in @collectable/red-black-tree@4.0.1.

@not-an-aardvark not-an-aardvark deleted the remove-last-tree-element branch July 11, 2017 21:19
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.

None yet

1 participant