Adds a new key to this priority queue
(&mut self, x: T)
| 79 | |
| 80 | /// Adds a new key to this priority queue |
| 81 | pub fn enqueue(&mut self, x: T) { |
| 82 | self.pq.push(x); |
| 83 | self.n += 1; |
| 84 | self.swim(self.n); |
| 85 | } |
| 86 | |
| 87 | /// MinPQ: Removes and returns a smallest key on this priority queue |
| 88 | /// MaxPQ: Removes and returns a largest key on this priority queue |