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)」
和 預期的「廉政」前基本表達式
這究竟是爲什麼以及怎麼可能解決?
感謝,它的工作 –