 
 PRIVATE>
 
-M: priority-queue heap-push* ( value key heap -- entry )
+M: heap heap-push* ( value key heap -- entry )
     [ <entry> dup ] keep [ data-push ] keep up-heap ;
 
 : heap-push ( value key heap -- ) heap-push* drop ;

USING: kernel math sequences arrays assocs sequences.private
growable accessors math.order ;
IN: heaps

MIXIN: priority-queue

GENERIC: heap-push* ( value key heap -- entry )
GENERIC: heap-peek ( heap -- value key )


: <max-heap> ( -- max-heap ) max-heap <heap> ;

M: heap heap-empty? ( heap -- ? )
    data>> empty? ;

M: heap heap-size ( heap -- n )
    data>> length ;

<PRIVATE
