0
我提出如下─无法访问功能
#include<iostream>
using namespace std;
/**
* Construct the binary heap.
* capacity is the capacity of the binary heap.
*/
class BinaryHeap
{
private:
int currentSize; // Number of elements in heap
int array[]; // The heap array
void buildHeap();
void percolateDown(int hole);
public:
bool isEmpty() const;
bool isFull() const;
int findmini() const;
void insert(int x);
void deleteMin();
void deleteMin(int minItem);
void makeEmpty();
public :
BinaryHeap()
{
currentSize = 0;
}
BinaryHeap(int capacity)
{
array[capacity + 1];
currentSize = 0;
}
};
int main()
{
int resp, ch, choice;
int n, i;
cout << "enter the size of heap" << endl;
cin >> n;
BinaryHeap b(int n);
cout << "enter the item " << endl;
cin >> ch;
b.insert(int ch);
return 0;
}
给出二进制堆的程序在编译它给误差的部件在“B”“插入”
请求,这是无级的型“二叉堆(INT)”
和 预期的“廉政”前基本表达式
这究竟是为什么以及怎么可能解决?
感谢,它的工作 –