mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Compare commits
2 Commits
73efc1c2ae
...
49f15c4532
Author | SHA1 | Date | |
---|---|---|---|
|
49f15c4532 | ||
|
587648a11e |
@ -22,7 +22,7 @@ export default class PriorityQueue extends MinHeap {
|
||||
* @param {number} [priority] - items priority.
|
||||
* @return {PriorityQueue}
|
||||
*/
|
||||
add(item, priority = 0) {
|
||||
add(item, priority = item) {
|
||||
this.priorities.set(item, priority);
|
||||
super.add(item);
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user