Skip to content

heap remove function has bug #179

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

Closed
watchsky opened this issue Aug 25, 2018 · 1 comment
Closed

heap remove function has bug #179

watchsky opened this issue Aug 25, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@watchsky
Copy link

watchsky commented Aug 25, 2018

|| !this.pairIsInCorrectOrder(parentItem, this.heapContainer[indexToRemove])

! should be removed . The test case is that min heap [1,2,3,4,5,6,7,8,9] remove 2 and should be expected '1,4,3,8,5,6,7,9' but get '1,9,3,4,5,6,7,8' with the wrong code.

@watchsky watchsky changed the title heap remove function was wrong heap remove function has bug Aug 25, 2018
@trekhleb trekhleb added the bug Something isn't working label Aug 27, 2018
trekhleb added a commit that referenced this issue Aug 27, 2018
@trekhleb
Copy link
Owner

@watchsky good catch! Thank you.

harshes53 pushed a commit to harshes53/javascript-algorithms that referenced this issue Dec 6, 2018
shoredata pushed a commit to shoredata/javascript-algorithms that referenced this issue Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants