Click to See Complete Forum and Search --> : iterating through a heap data structure (c++)...


Minime80
03-02-2004, 08:19 PM
Somebody prove me wrong, but I don't think there exists an efficient way to step through a heap structure without actually enqueueing and dequeueing because of the fact that siblings are not directly related in any way. The next largest or smallest number could be just about anywhere.

If anyone disagrees with this, or can think of an 'efficient' way to do this... by all means, speak up. I don't see any way to do this besides searching the entire list.