MinMax Heap implementation without an array
        Posted  
        
            by 
                user576531
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user576531
        
        
        
        Published on 2011-01-15T06:36:46Z
        Indexed on 
            2011/01/15
            6:53 UTC
        
        
        Read the original article
        Hit count: 279
        
heap
Hi. I found lots of MinMax Heap implementations, that were storing data in an array. It is realy easy to implement, that is way I am looking for something different. I want to create a MinMax Heap using only elements of the Heap with pointers to left child and right child (and afcourse a key to compare). So the Heap have only pointer to the root object (min level), and a root object have a pointer to his children (max level) and so on. I know how to insert a new object (finding a proper path by using binary represenation of int depending on Heap size), but I don't know how to implement the rest (push up (down) the element, find parent or grandparent).
Thx for help
© Stack Overflow or respective owner