Implementing a queue or stack using a heap
Title pretty much says it all. And before anybody asks YES this IS a HOMEWORK assignment.
I'm not asking you to solve it only to help me clarify and maybe give me a place to start.
I personally don't care what I end up using, stacks or queues, the differences are negligible to me and the only difference would be opposing comparisons I do believe. The only thing I'm really after is a starting point, my book offers nothing on this and I can't ask my teacher for the obvious reason of shes not the java teacher!
Anyway, I've done trees and BST's as well as stacks and queues but combing the 2 is leaving me to scratch my head at the moment, I was thinking of doing something like a priority queue..just with a heap. What I'm saying is pass the priority queue node the element and priority, and build a heap out of the priority. Does that make any sense?
Any help would be awesome, thanks
Re: Implementing a queue or stack using a heap