I have a project that I'm working on and am completly stuck. Here is the basic layout of my program:
I have a class that has in it's private members a hash table that has pointers to minHeaps. In this same class, I have as a private member a maxHeap. In my minHeap code, I need to add an item to my maxHeap. I can't seem to find any possible way to do this! Here is my class structure:
-add_tunnel(double height, int highway) - adds an item into one of the minHeaps in the hash table.
-get_system_bottleneck() - pulls the first item in the maxHeap
-numerous other functions.....
// Here's my problem!
-hwyInsertTunnel( double tHeight) - inserts an item in the heap, if it's the smallest item in the minHeap, then add it in the parent's maxHeap
-a bunch of other functions...
What is the best way to make it so that hwyInsertTunnel can access HighwaySystem's maxHeap?
Thanks a bunch!