0

Max Fibonacci heaps can have one pointer to the max element of the structure. But how do I find 'n' of these? As in, how do I find the next max element after the current one?

One caveat is that I cannot remove elements from the structure as the structure might be queried again, for a different number of max elements. For example, I might be asked for the top 3 elements one time and then be queried about top 5 elements.

Or does this necessitate a remove and reinsert? If that's the case, am I better off storing the max elements in a stack/queue and then reinsert them once we serve the query? Also, wouldn't this alter the structure of the tree?

tinkuge
  • 97
  • 1
  • 11

0 Answers0