【HeapSift】
[code]inputs:MyArray[MaxSize]( numericarrayref ),
int ColIndx1( numericsimple ),
int Size( numericsimple ),
int Order( numericsimple ) ;
variables:
int var0( 0 ),
int var1( 0 ) ;
var0 = ColIndx1 ;
var1 = 2 * var0 ;
while var1 <= Size and HeapPush( MyArray, var1, Size, Order )
begin
MyArray[var0] = MyArray[var1] ;
var0 = var1 ;
var1 = 2 * var0 ;
end ;
MyArray[var0] = MyArray[0] ;
HeapSift = true ;
[/code]
页:
[1]