【HeapPush2D】
[code]inputs:MyArray[ MaxSize1, MaxSize2 ]( numericarray ),
int ColIndx3( numericref ),
int Size( numericsimple ),
int Order( numericsimple ) ;
variables:
int var0( 0 ) ;
if Order = -1 then
begin
if ColIndx3 < Size then
begin
var0 = ColIndx3 + 1 ;
condition1 = MyArray[ 1, var0 ] > MyArray[ 1, ColIndx3 ] ;
if condition1 then
ColIndx3 = var0 ;
end ;
HeapPush2D = ( MyArray[ 1, 0 ] < MyArray[ 1, ColIndx3 ] ) ;
end
else if Order = 1 then
begin
if ColIndx3 < Size then
begin
var0 = ColIndx3 + 1 ;
condition1 = MyArray[ 1, var0 ] < MyArray[ 1, ColIndx3 ] ;
if condition1 then
ColIndx3 = var0 ;
end ;
HeapPush2D = ( MyArray[ 1, 0 ] > MyArray[ 1, ColIndx3 ] ) ;
end
else
RaiseRunTimeError( "Order input must be -1 or 1." ) ;
[/code]
页:
[1]