?? heap.h
字號:
#ifndef HEAP_H
#define HEAP_H
typedef int Type;
class Heap
{
private:
Type * array;
int MaxSize,Nel;
//最大堆容量, nel 現在堆有的元素個數
void Adjust(Type a[],int i,int n);
public:
Heap(int MSize):MaxSize(MSize)
{
array = new Type[MaxSize + 1];
Nel = 0;
}
~Heap()
{
delete []array;
}
bool Insert(Type item);
//insert item
bool DelMax(Type & item);
//delete the maximum
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -