Board logo

标题: 【HeapPush】 [打印本页]

作者: 龙听    时间: 2022-11-2 09:57     标题: 【HeapPush】

  1. inputs:
  2.         MyArray[MaxSize]( numericarray ),  
  3.         int ColIndx3( numericref ),
  4.         int Size( numericsimple ),
  5.         int Order( numericsimple ) ;                                    

  6. variables:
  7.         int var0( 0 ) ;

  8. if Order = -1 then
  9.         begin
  10.         if ColIndx3 < Size then
  11.                 begin
  12.                 var0 = ColIndx3 + 1 ;
  13.                 condition1 = MyArray[var0] > MyArray[ColIndx3] ;
  14.                 if condition1 then
  15.                         ColIndx3 = var0 ;
  16.                 end ;
  17.         HeapPush = ( MyArray[0] < MyArray[ColIndx3] ) ;
  18.         end
  19. else if Order = 1 then
  20.         begin
  21.         if ColIndx3 < Size then
  22.                 begin
  23.                 var0 = ColIndx3 + 1 ;
  24.                 condition1 = MyArray[var0] < MyArray[ColIndx3] ;
  25.                 if condition1 then
  26.                         ColIndx3 = var0 ;
  27.                 end ;
  28.         HeapPush = ( MyArray[0] > MyArray[ColIndx3] ) ;
  29.         end
  30. else
  31.         RaiseRunTimeError( "Order input must be -1 or 1." ) ;
复制代码





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2