1. 首页
  2. 数据库
  3. 其它
  4. C++动态数组简单的模拟二元堆

C++动态数组简单的模拟二元堆

上传者: 2021-01-14 21:47:21上传 PDF文件 21.63KB 热度 8次
//C++动态数组简单的模拟二元堆 #include using namespace std; class BinaryHeap { private: int cap; //该阵列的大容量 int size; //当前元素个数 int* datas; //数组首地址 public: explicit BinaryHeap(int cap_) :cap(cap_), size(0) { datas = new int[cap]; } ~BinaryHeap(){ delete datas; } void Insert(int); int De
下载地址
用户评论