how do you make those horizontal lines to "repost" a quote from somebody else?
Cancel
Save
well,, going back to the whole priority queue & heap thing... I was wondering if I should implement a heap that is pointer-based or array-based. what would be the benefits and disadvantages of each?
Cancel
Save
ok, i made up my mind...im going to write a heap that is represented by an array. but i still have a question regarding even this! Would it be quite alright with respect to speed and efficiency if i used a dynamically resizeable array, like a vector???
Cancel
Save
quote:second, is there pseudocode to sort a tree for the max/min key in the tree? because my data structures textbook sure doesnt offer any. I was saying you don''t need to search, you can just keep track of the min/max as you insert it into your class.
Cancel
Save
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
you are saying that the min/max does not need to be at the top, or in my array-based case, at index 0? i dont think this will work. i COULD leave everything unsorted and simply remove the element with the smallest/largest key. but that would still mean sorting it at some point in time so that if a new element is inserted it''s key must be checked with others.
Cancel
Save
I think what antareus was saying is that if you sort your tree, then you don't have to search at all because the highest priority item will always be in the same place. [edited by - Martel on September 4, 2003 12:58:33 AM]
Cancel
Save