📄 minheap4.cpp
字号:
#include <iostream.h>
#include "minheap4.h"
void main(void)
{
MinHeap<int> H(4);
H.Insert(10).Insert(20).Insert(5).Insert(30);
cout << "Elements in array order" << endl;
H.Output();
H.ChangeMin(2);
cout << "Min element replaced by 2" << endl;
cout << "Elements in array order" << endl;
H.Output();
H.ChangeMin(15);
cout << "Min element replaced by 15" << endl;
cout << "Elements in array order" << endl;
H.Output();
H.ChangeMin(40);
cout << "Min element replaced by 40" << endl;
cout << "Elements in array order" << endl;
H.Output();
H.ChangeMin(25);
cout << "Min element replaced by 1" << endl;
cout << "Elements in array order" << endl;
H.Output();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -