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

📄 maxheap4.cpp

📁 数据结构c++语言描述 Borland C++实现
💻 CPP
字号:

#include <iostream.h>
#include "maxheap4.h"

void main(void)
{
   MaxHeap<int> H(15);
   int x;
   H.Insert(10).Insert(20).Insert(5).Insert(3);
   H.Insert(30).Insert(15).Insert(6).Insert(4);
   H.Insert(9).Insert(11).Insert(1).Insert(50);
   cout << "Elements in array order" << endl;
   H.Output();
   H.DeleteMax(x);
   cout << "Deleted max element " << x << endl;
   cout << "Elements in array order" << endl;
   H.Output();
   H.DeleteMax(x);
   cout << "Deleted max element " << x << endl;
   cout << "Elements in array order" << endl;
   H.Output();
   H.DeleteMax(x);
   cout << "Deleted max element " << x << endl;
   cout << "Elements in array order" << endl;
   H.Output();
   H.DeleteMax(x);
   cout << "Deleted max element " << x << endl;
   cout << "Elements in array order" << endl;
   H.Output();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -