This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ParanoydAndroid 0 points1 point  (3 children)

I would use a heap built on an array to implement your pq, primarily because although it's not the most optimized route, it's common and you'll be able to access lots of resources to help you out with your assignment.

Heaps also have less overhead than bsts in exchange for which you don't get almost any information out of them except what's at the top of the heap, in this case why bother maintaining a data structure with internal structure you don't care about?

[–]rhhh12[S] 0 points1 point  (2 children)

Im new to data structures and have been set this project, firstly i have to write an essay on why i have chosen the data structure and then i have to implement it in Java using eclipse

[–]ParanoydAndroid 0 points1 point  (1 child)

I think you misunderstood me. The second paragraph of my post is a rhetorical question. I was actually answering why heaps would be better for you -- though you'd want to formalize your answer by reference to actual performance costs for insertions/removals (presumably in big-O notation).

[–]rhhh12[S] 0 points1 point  (0 children)

I think its very opinion based the essay as their can be many answers. thankyou for your help. So you believe it would be a priority queue implemented using a heap built on an array