#ifndef MINHEAP_H
#define MINHEAP_H
#include "State.h"

class MinHeap
{  public:

      MinHeap(int size);
//    There's lots of dynamic allocation going on, so give it all back!
     ~MinHeap();

      int  isEmpty ( void );

      int  size ( void );

      void add ( State* );    // Make an entry into the minheap

      State* remove ( void );    // Remove an entry from the minheap

   protected:

      void upHeap(int P);    // Correct the heap from P upwards
      void downHeap(int P);  // Correct the heap from P downwards

      State **Heap;          // Dynamic array of pointers
      int     N,             // Number of queued entries (logical size)
              Size;          // Physical size of the heap (allocation)
};
#endif
