diff --git a/src/data-structures/priority-queue/PriorityQueue.js b/src/data-structures/priority-queue/PriorityQueue.js index 0b283c2c..94bda233 100644 --- a/src/data-structures/priority-queue/PriorityQueue.js +++ b/src/data-structures/priority-queue/PriorityQueue.js @@ -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;