摘要:
public class Heap{public static void main(String[] args){ Heap h=new Heap(); int[] heap=new int[]{1,2,3,4,5,6,7,8,9}; h.buildMaxHeap(heap); for(int i=0;i=0;i--){ maxHeap(heap,i,heap.length); }}public void maxHeap(int[] heap,int index,int len){ int left=(indexheap[largest]){... 阅读全文