Skip to content

Instantly share code, notes, and snippets.

@zaveri zaveri/gist:371450
Created Apr 19, 2010

Embed
What would you like to do?
class BinaryHeap
{
public:
explicit BinaryHeap(int capacity = 100);
explicit BinaryHeap(const vector<char> & items);
bool isEmpty( ) const;
const char & findMin( ) const;
void insert(char s);
void deleteMin( );
void deleteMin( char & minItem );
void makeEmpty( );
private:
int currentSize; // Number of elements in heap
vector<char> array; // The heap array
void buildHeap( );
void percolateDown( int hole );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.