【SortHeap2DArray】
[code]inputs:MyArray[ MaxSize1, MaxSize2 ]( numericarrayref ),
int Size1( numericsimple ),
int Size2( numericsimple ),
int Order( numericsimple ) ;
variables:
int var0( 0 ),
var1( false ) ;
if Size2 > 1 then
begin
for var0 = IntPortion( Size2 / 2 ) downto 1
begin
var1 = CopyColumn( MyArray, 0, var0, 1, Size1 ) ;
var1 = HeapSift2D( MyArray, var0, Size1, Size2, Order ) ;
end;
for var0 = Size2 downto 2
begin
var1 = CopyColumn( MyArray, 0, var0, 1, Size1 ) ;
var1 = CopyColumn( MyArray, var0, 1, 1, Size1 ) ;
var1 = HeapSift2D( MyArray, 1, Size1, var0 - 1, Order ) ;
end ;
end ;
SortHeap2DArray = true ;
[/code]
页:
[1]