#include <cstdlib>
#include <iostream>
#include <vector>
template <typename Comparable>
class minHeap
{
//Name: minHeap
//Description: Stores Edge objects in descending order based on their cost.
public:
//Member Functions:
//Name: explicit constructor
//Prototype: explicit minHeap(int size = 0) : heap(size+1), current(0){}
//Description: creates a minHeap for edges to be stored in
//Preconditions: accepts integer for number of elements to be stored
//Postconditions: creates a heap of size+1, default = 0; sets currentSize = 0
//Cost Analysis: O(n) n = size+1
//Visibility: Public
explicit minHeap(int size = 0) : heap(size+1), currentSize(0){}
//Name: insert
//Prototype: void insert(Comparable & inEdge);
//Description: inserts edge into the heap
//Preconditions: accepts reference to the Edge to be inserted
//Postconditions: inserts inEdge into appropriate position; currentSize++
//Cost Analysis: O(log(n)) ; n = current size of heap
//Visibility: Public
void insert(Comparable & inEdge);
//Name: delete
//Prototype: void deleteMin(Comparable & minEdge);
//Description: makes reference to cheapest edge and deletes it
//Preconditions: accepts reference to Edge
//Postconditions: minEdge = cheapest edge ; cheapest edge deleted; currentSize--
//Cost Analysis: O(log(n)) ; n = current size of heap
//Visibility: Public
void deleteMin(Comparable & minEdge);
//Name: is empty
//Prototype: bool isEmpty() const;
//Description: decides if the heap is empty
//Preconditions:
//Postconditions: returns true if the heap is empty
//Cost Analysis: O(1) constant time
//Visibility: Public
bool isEmpty() const;
//Name: percolate down
//Prototype: void percolateDown(int hole);
//Description: sorts the array after a deletion
//Preconditions: accepts index of heap where new hole exists
//Postconditions: places new item in hole when possible
//Cost Analysis: O(log(n)) ; n = current size of heap
//Visibility: Public
void percolateDown(int hole);
private:
//Data members:
//Name: current size
//Description: keeps track of current size of the heap
//Type: int
int currentSize;
//Name: heap
//Description: structure to hold templated type
//Type: vector<Comparable>
vector<Comparable> heap;
};
error: vector doesn't name a type.... I literally copied a class I've already written which is going to be used for another project but vector just says: "no" any idea? I still refuse to respect netbeans on windows to be honest it always does crazy bullshit like this.