#ifndef BINARY_HEAP_H_
#define BINARY_HEAP_H_
#include <iostream>
#include <vector>

using namespace std;

class NodeData {
  public:
  
  int key;
  
  NodeData(int pKey = 0) : key(pKey) {}
  
  /**
   * Prints the data and key for this Node to cout
   */
  void print() {
    cout << key;
  }
};

class BinaryHeap {
  public:
    int currentSize; // Number of elements in heap
    vector<NodeData*> array; // The heap array

    BinaryHeap(int capacity = 100);
    
    bool isEmpty() const;
    bool isFull() const;

    NodeData* findMin() const;
    
    void buildHeap();

    void insert(NodeData * x);
    NodeData * deleteMin();

  private:
    void percolateDown(int hole);
};

#endif
