* Push an element into the queue with a given priority. * The queue should not be a priority queue. * @return true if success; otherwise false, e.g., due to capacity constraint. */
| 120 | * @return true if success; otherwise false, e.g., due to capacity constraint. |
| 121 | */ |
| 122 | bool Push(const T& e, int priority) { |
| 123 | Element ele; |
| 124 | ele.data = e; |
| 125 | ele.priority = priority; |
| 126 | queue_.push(ele); |
| 127 | return true; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Pop an element from the queue with the highest priority. |