Created
April 19, 2010 19:09
-
-
Save zaveri/371450 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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