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

chapter 16 minHeap misspelled method #4

Open
ljmerza opened this issue Feb 18, 2019 · 0 comments
Open

chapter 16 minHeap misspelled method #4

ljmerza opened this issue Feb 18, 2019 · 0 comments

Comments

@ljmerza
Copy link

ljmerza commented Feb 18, 2019

if (this.rightChild(index) && this.rightChild(index) < this.items[smallerIndex]) {
    // if right is smaller, right swaps
    smallerIndex = this.rightChildrenIndex(index);
}

rightChildrenIndex doesn't exist I think you meant rightChildIndex

EDIT: I realized this is a mistake on my part. rightChildrenIndex is defined and rightChildIndex is not. It was a little confusing when typing up the implementation because the left child is called leftChildIndex and leftChild and the right side node getter is rightChild so it made sense for the right side index getter to be rightChildIndex

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

No branches or pull requests

1 participant