So I've got an assignment of creating a priority queue using a heap data structure. I've read lots of pages online about the heap data structure, but I keep coming up with questions.
In my class, I got the impression that a heap was structured similarly to a tree - parent node/child node type stuff. But the more I read online, it appears that the method of choice is fashioning a heap based on an underlying array - which way is generally preferred?
Because as I started to work through a tree based solution, I stumble trying to determine when I've found the left most opening for the bottom level of the tree to insert a new value in.
All that being said, absolutely any tips or advice about the underlying data structure for a priority queue would be greatly appreciated. I'm not really looking for code samples, just a push in the right direction. Many thanks!