(int index)
| 16 | return list.size(); |
| 17 | } |
| 18 | private void upheap(int index){ |
| 19 | |
| 20 | if(index == 0){ |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | int p = parent(index); |
| 25 | |
| 26 | if(list.get(index).compareTo(list.get(p)) < 0){ |
| 27 | swap(index, p); |
| 28 | upheap(p); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | public T remove() throws Exception{ |
| 33 | if(list.isEmpty()){ |