(int capacity)
| 69 | |
| 70 | // resize the underlying array to have the given capacity |
| 71 | private void resize(int capacity) { |
| 72 | // assert capacity > n; |
| 73 | int[] temp = new int[capacity]; |
| 74 | for (int i = 1; i <= n; i++) { |
| 75 | temp[i] = pq[i]; |
| 76 | } |
| 77 | pq = temp; |
| 78 | } |
| 79 | |
| 80 | |
| 81 | /** |