modify code

master
algorithmzuo 4 years ago
parent fdab79726d
commit d6570a1f53

@ -42,11 +42,6 @@ public class Code02_Heap {
return ans;
}
// 新加进来的数现在停在了index位置请依次往上移动
// 移动到0位置或者干不掉自己的父亲了
private void heapInsert(int[] arr, int index) {
@ -124,7 +119,6 @@ public class Code02_Heap {
}
public static class MyComparator implements Comparator<Integer> {
@Override
@ -135,6 +129,7 @@ public class Code02_Heap {
}
public static void main(String[] args) {
// 小根堆
PriorityQueue<Integer> heap = new PriorityQueue<>(new MyComparator());
heap.add(5);
@ -154,12 +149,6 @@ public class Code02_Heap {
System.out.println(heap.poll());
}
int value = 1000;
int limit = 100;
int testTimes = 1000000;

Loading…
Cancel
Save