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

Wrong Tree count when removing interval corresponding to mid of interval tree #17

Open
AyushMittal1999 opened this issue Jan 25, 2022 · 1 comment · May be fixed by #18
Open

Wrong Tree count when removing interval corresponding to mid of interval tree #17

AyushMittal1999 opened this issue Jan 25, 2022 · 1 comment · May be fixed by #18

Comments

@AyushMittal1999
Copy link

Considering the following set of 10 intervals
var intervals = [[0, 1], [1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16] ,[90, 100]];

When we try to remove interval [9, 10] which corresponds to root of interval tree (mid of root lies in this interval), the count of tree is updated to 8 instead of 9.

The wrong count occurs only when we have one interval belonging to root of the tree, and try to remove it.

@AyushMittal1999
Copy link
Author

Have raised the fix for the issue, and request @mikolalysenko to please check the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant