Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Create a new internal array with a given capacity */
- @SuppressWarnings("unchecked")
- private void resize(int capacity) {
- Item[] copy = (Item[]) new Comparable[capacity]; // 1
- for (int i = 1; i <= length; i++) { // 2
- copy[i] = pq[i]; // 2
- }
- pq = copy; // 3
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement