标题:
【HeapPush】
[打印本页]
作者:
龙听
时间:
2022-11-2 09:57
标题:
【HeapPush】
inputs:
MyArray[MaxSize]( 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[var0] > MyArray[ColIndx3] ;
if condition1 then
ColIndx3 = var0 ;
end ;
HeapPush = ( MyArray[0] < MyArray[ColIndx3] ) ;
end
else if Order = 1 then
begin
if ColIndx3 < Size then
begin
var0 = ColIndx3 + 1 ;
condition1 = MyArray[var0] < MyArray[ColIndx3] ;
if condition1 then
ColIndx3 = var0 ;
end ;
HeapPush = ( MyArray[0] > MyArray[ColIndx3] ) ;
end
else
RaiseRunTimeError( "Order input must be -1 or 1." ) ;
复制代码
欢迎光临 龙听期货论坛 (http://www.qhlt.cn/)
Powered by Discuz! 7.2