Introduction To Algorithms-HeapSort-BuildHeap
#define LENGTH(x) (sizeof(x)/sizeof(x[0]))static int heap_size = 0;int parent(int i){ return (i)/2;}int left(int i){ return 2*(i);}int right(int i){ return 2*(i)+1;}void maxHeapify(int A[], int i){ int largest; in
原创
2011-02-05 23:08:00 ·
479 阅读 ·
0 评论