en/chapter_heap/heap/ #1693
Replies: 1 comment
-
|
Extraordinary how hot checks on the if (l < this.size() && this.#maxHeap[l] > this.#maxHeap[ma]) ma = l;
if (r < this.size() && this.#maxHeap[r] > this.#maxHeap[ma]) ma = r;If the selected node index for swapping isn't the one with the largest difference (in either max or min heaps), both looped and recursive approaches will fail to heapify in a single pass. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
en/chapter_heap/heap/
Data Structures and Algorithms Crash Course with Animated Illustrations and Off-the-Shelf Code
https://www.hello-algo.com/en/chapter_heap/heap/
Beta Was this translation helpful? Give feedback.
All reactions