(value: T)
| 10 | } |
| 11 | |
| 12 | push(value: T): SortedQueueItem<T> { |
| 13 | const item = new Item(value, this._array, this._array.length, this._cmp); |
| 14 | this._array.push(item); |
| 15 | siftUp(this._array, item, this._cmp); |
| 16 | return item; |
| 17 | } |
| 18 | |
| 19 | peek(): SortedQueueItem<T> | undefined { |
| 20 | return this._array.length > 0 ? this._array[0] : undefined; |