DEV Community

Discussion on: Algorithm Tutorial: Intro to Heaps and Priority Queue Implementation

Collapse
 
artemkislov profile image
Artem Kislov

Thank you for reply!
But I still don't see any comparisons using priority. Yeah, you pass priority, but you compare objects, not priority values. I talk about Full code section -> class MaxHeapPriorityQueue. So MaxHeapPriorityQueue class looks the same as MaxHeap (except formatting)

Thread Thread
 
dsasse07 profile image
Daniel Sasse • Edited

Oh! I see what you mean now. It looks like I forgot to update the gist from my local file (which is what I looked at after your previous comment). I updated the gist from my local file, namely lines 28 of _bubble_up() and 73 & 88 of _trickle_down()

Thank you for bringing it to my attention, and persisting!