Rank: 243140 based on 0 downloads (last 30 days) and 0 file submitted

Jeremy Kawahara


Personal Profile:


Watch this Author's files


Comments and Ratings by Jeremy Kawahara
Updated File Comments Rating
20 Oct 2012 Priority Queue (MEX/C++) An efficient priority queue implementation in C++ Author: Andrea Tagliasacchi

Hi, great code! Thanks for sharing! :)

Two small bugs...

1) The current MinHeap will keep adding elements instead of updating them.

The fix is to remove the extra "useBackIdx" condition in "MyHeap.H" in the MinHeap->void push() function.

So change line 316
if( useBackIdx || backIdx[index] == -1 ){

if( backIdx[index] == -1 ){

2) To get this code to work on a 64-bit machine I had to change the addresses from "long" to "unsigned long long". I did this change pretty much anytime something I saw something was cast to a "long".

Hope that helps!
Thanks! -- Jeremy

Contact us