/*
Name: Anne Dawson
Program: heapdriver.cpp
Description: This is the driver file for testing the heap class.
*/


#include <iostream.h>
#include <stdlib.h>
#include "binaryHeap.h"
#include <conio.h>

int main()
{

CBinaryHeap<int> heap_a;


cout << "\nFirst testing the insert function:\n";

	for(int i=0; i<25; i++)
	{
		heap_a.insert(rand());
	}

cout << "\nbinaryHeap currently has " << heap_a.size() << " elements\n";

	heap_a.print();


cout << "\nNow testing the gettop function\n";

	cout << "top is " << heap_a.getTop() << endl;
	heap_a.print();

cout << "\nNow testing  reheapup function by inserting 3 into the heap:\n";

	heap_a.insert(3);
   heap_a.print();


cout << "\nNow emptying the heap that was full using the makeempty function\n";;
	heap_a.makeEmpty();
	heap_a.print();

cout << "\nNow testing the isempty function on the empty heap\n";
while(!heap_a.isEmpty())
{
	heap_a.deleteTop();
}
heap_a.print();

getch();

return 0;
}

