* Removes the element with least priority * @returns the key of the element with least priority
()
| 53 | * @returns the key of the element with least priority |
| 54 | */ |
| 55 | pop() { |
| 56 | this._swap(0, this._heap.length - 1) |
| 57 | const key = this._heap.pop() |
| 58 | this.priorities.delete(key) |
| 59 | this._shiftDown(0) |
| 60 | return key |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Checks whether a given key is present in the queue |
no test coverage detected