mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-15 21:20:58 +00:00
Update code extractor of Java.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
#define MAX_SIZE 5000
|
||||
|
||||
// 大顶堆
|
||||
/* 大顶堆 */
|
||||
typedef struct maxHeap {
|
||||
// size 代表的是实际元素的个数
|
||||
int size;
|
||||
@@ -20,14 +20,6 @@ void siftDown(maxHeap *h, int i);
|
||||
|
||||
void siftUp(maxHeap *h, int i);
|
||||
|
||||
/* 构造空堆 */
|
||||
maxHeap *newEmptyMaxHeap() {
|
||||
// 所有元素入堆
|
||||
maxHeap *h = (maxHeap *) malloc(sizeof(maxHeap));
|
||||
h->size = 0;
|
||||
return h;
|
||||
}
|
||||
|
||||
/* 构造函数,根据切片建堆 */
|
||||
maxHeap *newMaxHeap(int nums[], int size) {
|
||||
// 所有元素入堆
|
||||
|
||||
Reference in New Issue
Block a user