dijkstrajs icon indicating copy to clipboard operation
dijkstrajs copied to clipboard

Implement priority queue with min-heap

Open hra4h03 opened this issue 3 years ago • 0 comments

I adopted the priority queue implementation with a min-heap data structure for better performance. I write the code in ES5 for backward compatibility with the previous version and for being upgradable.

The previous current version is using queue.sort() for insertion with complexity of n*log(n). With min-heap, the complexity will be log(n).

hra4h03 avatar Dec 26 '21 18:12 hra4h03