- UID
- 2
- 积分
- 2874664
- 威望
- 1387361 布
- 龙e币
- 1487303 刀
- 在线时间
- 13156 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【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." ) ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|