【HeapSift2D】
[code]inputs:MyArray[ MaxSize1, MaxSize2 ]( numericarrayref ),
int ColIndx1( numericsimple ),
int Size1( numericsimple ),
int Size2( numericsimple ),
int Order( numericsimple ) ;
variables:
int var0( 0 ),
int var1( 0 ),
var2( false ) ;
var0 = ColIndx1 ;
var1 = 2 * var0 ;
while var1 <= Size2 and HeapPush2D( MyArray, var1, Size2, Order )
begin
var2 = CopyColumn( MyArray, var0, var1, 1, Size1 ) ;
var0 = var1 ;
var1 = 2 * var0 ;
end;
var2 = CopyColumn( MyArray, var0, 0, 1, Size1 ) ;
HeapSift2D = true ;
[/code]
页:
[1]