⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 heap.h

📁 堆排序算法
💻 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 + -