/* Filename: heap.h Programmer: Br. David Carlson Reference: Data Structures with C++, by Ford and Topp, pp 690, 691. Date: October 4, 1997 Revised: June 19, 1999 This is the header file to accompany heap.cpp. */ #include "arrayutl.h" class HeapClass { public: HeapClass(IntArrayType IntArray, int Count); int Delete(void); void Insert(int Item); private: int * HeapArrayPtr; // pointer to array holding the heap data int MaxHeapSize; int HeapSize; void FilterDown(int StartIndex); void FilterUp(int StartIndex); // Useful private functions. Automatically inline functions // when put their code here: int Parent(int CurrentIndex) { return (CurrentIndex - 1) / 2; } int RightChild(int CurrentIndex) { return 2 * (CurrentIndex + 1); } int LeftChild(int CurrentIndex) { return 2 * CurrentIndex + 1; } };