摘要:
/* 建造最大堆 */ // 创建堆 function CreateHeap(MaxSize,MaxData,initialData) { this.MaxSize = MaxSize; this.Heap = initialData; if(!initialData) { this.Heap = 阅读全文
摘要:
// 创建堆 function CreateHeap(MaxSize,MaxData) { this.MaxSize = MaxSize; this.Heap = new Array(); this.Heap[0] = MaxData // 定义" 哨兵 " 为大于堆中所有可能元素的值 this.i 阅读全文