ELF>@@8 @  33PPPt#t#@}@@X}XX888$$PtdmmmQtdRtd@}@@GNU~ym4`Y}-y:Ml c' 5t, F"U  __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizePyInit__heapqPyModuleDef_InitPyUnicode_FromStringPyModule_AddObject_Py_DeallocPyObject_RichCompareBoolPyExc_RuntimeErrorPyErr_SetString_Py_NoneStruct_PyArg_BadArgumentPyExc_IndexErrorPyList_SetSlicePyList_Append_PyArg_CheckPositionallibpthread.so.0libc.so.6GLIBC_2.2.5/opt/alt/python312/lib64:/opt/alt/openssl11/lib64:/opt/alt/sqlite/usr/lib64\ui f@CHCPP(P0`c@H;PȐ(ؐlhP@3i3P#@l OP( *8j@PHX@i`tPh=xi[Pp.`hP@hȏЏ؏   px  HHHtH5:%<@%:h%2h%*h%"h%h%h% h%hp%~h`%~h P%~h @HEx HHEt HNL~H5?I:F1H|$LD$H|$D$i H=~H5>H? yLD$LD$LD$D$LMExILMuHHD$LD$LT$LT$D$H~H5P>H:~H=~H55>H?mcL3IVtZHsL|INLyL9>L-}H5=I} HD$ H $H $D$ HIFJ4ML3IVtRM~HKM"MfDI,$Hl$ADHD$LL$LL$D$H|H5.=H:fH |H5=H9KiAEtAE1LH1,AutAu1LHHUxHHUIMxHIM<)HIFM;fL J<L/A $tA $1LL&MMExIMMuLD$D$I<$xHI<$uLD$D$LD$M;FtL5'zH5:I>bX&LyH5:I:}7HD$YD$LyH5:I;JHyH59H;,LD$D$HMxHHME1^HֹH=9tLmMEAt6I}LeMMI)DUAWDUNE,$LH,9E1H5\9H=y9HE1LH=xH5 9H?A1#H xH58H9$1"LxH58I:1"LD$D$M$ExIM$uLD$D$'I;n2L5~wH5G8I>&AEtAE1LHHMxHHMuHD$D$IuxHIu&MVHM;~M&HvH57H;va&H-vH5#7H}ZE&L-vH57I}>)&H!HD$A&HH6H56H=7&HD$&LD$D$;%&AUtAU1LLMExIMuLD$D$M]ExIM]uLD$lD$'IWHI9oH H< L/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IGIHI $L3M4$H L9,$?LFHD$HLЅfHl$H\$H9\$(AHUHH[]A\A]A^A_AtAL1LD$H<$H<$Ht$LEx!ILuD$H4$D$H4$LEx ILuH$$fBIIGI;orNJ H9NMLI:M9~MgM9wIL9M0I}AHH,Hl$H,oAEnE1HH<$LHuL$HHucMEx IM xoM;gcIGH|$N,HH/MuL7ImL9LQSH5I;1HDEAtDEH<$1HLHML$x%HHMuHD$ L$kD$ L$MEIM~fAomHRH5qH8)1LRH5TI8 1 lHdRH5-H:1 E ; 1 ' AWAVIAUATUSH(HF+H^H[HVHlMtM1HsHLjHMVM~I2I*Ht$MLHH|$E1O$IXIM,M9K,DMADMEUAEU1LHL]EIL]IUHIU_xCMVHM;~LO$O,I,$I}ImI<$H9\$~PI6L\$IlHI_LHD$HD$H([]A\A]A^A_fDInH9JO$IH[HM,L LL$EUAEUE$AE$1LL{IUHIUI $HI $I;n;MVH<LOHl$HgOH5H8HD$fAWAVAUATUSHH(H]L>IGzIoLFHIWA8H HL$@A8LH9HHHt$E1O4$I^IH H< L/I9N4A;AAM8AML1LI>JHI>-IuTHIu6xCIWHI9o>H N$L, M$MMMEM $H;\$}gI2Ht$LElIL_HAHD$HD$H([]A\A]A^A_@N4IHM.H;\$|@MoL97IL4IH[HH,Hl$H,ߋuuEAE1LHLEEILEMEIM M9o&IHD$N$HH(M4$L0I,$HDfH=NHNH9tHLHt H=NH5NH)HH?HHHtHuLHtfD=ENu+UH=RLHt H=IdN]wHH__about__listargumentheapifyindex out of rangeheappopheappushargument 1heapreplace_heapify_maxheappushpop_heappop_max_heapreplace_max_heapqlist changed size during iterationHeap queues [explanation by François Pinard] Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. The strange invariant above is meant to be an efficient memory representation for a tournament. The numbers below are `k', not a[k]: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'. In a usual binary tournament we see in sports, each cell is the winner over the two cells it tops, and we can trace the winner down the tree to see all opponents s/he had. However, in many computer applications of such tournaments, we do not need to trace the history of a winner. To be more memory efficient, when a winner is promoted, we try to replace it by something else at a lower level, and the rule becomes that a cell and the two cells it tops contain three different items, but the top cell "wins" over the two topped cells. If this heap invariant is protected at all time, index 0 is clearly the overall winner. The simplest algorithmic way to remove it and find the "next" winner is to move some loser (let's say cell 30 in the diagram above) into the 0 position, and then percolate this new 0 down the tree, exchanging values, until the invariant is re-established. This is clearly logarithmic on the total number of items in the tree. By iterating over all items, you get an O(n ln n) sort. A nice feature of this sort is that you can efficiently insert new items while the sort is going on, provided that the inserted items are not "better" than the last 0'th element you extracted. This is especially useful in simulation contexts, where the tree holds all incoming events, and the "win" condition means the smallest scheduled time. When an event schedule other events for execution, they are scheduled into the future, so they can easily go into the heap. So, a heap is a good structure for implementing schedulers (this is what I used for my MIDI sequencer :-). Various structures for implementing schedulers have been extensively studied, and heaps are good for this, as they are reasonably speedy, the speed is almost constant, and the worst case is not much different than the average case. However, there are other representations which are more efficient overall, yet the worst cases might be terrible. Heaps are also very useful in big disk sorts. You most probably all know that a big sort implies producing "runs" (which are pre-sorted sequences, which size is usually related to the amount of CPU memory), followed by a merging passes for these runs, which merging is often very cleverly organised[1]. It is very important that the initial sort produces the longest runs possible. Tournaments are a good way to that. If, using all the memory available to hold a tournament, you replace and percolate items that happen to fit the current run, you'll produce runs which are twice the size of the memory for random input, and much better for input fuzzily ordered. Moreover, if you output the 0'th item on disk and get an input which may not fit in the current tournament (because the value "wins" over the last output value), it cannot fit in the heap, so the size of the heap decreases. The freed memory could be cleverly reused immediately for progressively building a second heap, which grows at exactly the same rate the first heap is melting. When the first heap completely vanishes, you switch heaps and start a new run. Clever and quite effective! In a word, heaps are useful memory structures to know. I use them in a few applications, and I think it is good to keep a `heap' module around. :-) -------------------- [1] The disk balancing algorithms which are current, nowadays, are more annoying than clever, and this is a consequence of the seeking capabilities of the disks. On devices which cannot seek, like big tape drives, the story was quite different, and one had to be very clever to ensure (far in advance) that each tape movement will be the most effective possible (that is, will best participate at "progressing" the merge). Some tapes were even able to read backwards, and this was also used to avoid the rewinding time. Believe me, real good tape sorts were quite spectacular to watch! From all times, sorting has always been a Great Art! :-) Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usage: heap = [] # creates an empty heap heappush(heap, item) # pushes a new item on the heap item = heappop(heap) # pops the smallest item from the heap item = heap[0] # smallest item on the heap without popping it heapify(x) # transforms list into a heap, in-place, in linear time item = heapreplace(heap, item) # pops and returns smallest item, and adds # new item; the heap size is unchanged Our API differs from textbook heap algorithms as follows: - We use 0-based indexing. This makes the relationship between the index for a node and the indexes for its children slightly less obvious, but is more suitable since Python uses 0-based indexing. - Our heappop() method returns the smallest item, not the largest. These two make it possible to view the heap as a regular Python list without surprises: heap[0] is the smallest item, and heap.sort() maintains the heap invariant! _heapify_max($module, heap, /) -- Maxheap variant of heapify._heapreplace_max($module, heap, item, /) -- Maxheap variant of heapreplace._heappop_max($module, heap, /) -- Maxheap variant of heappop.heapify($module, heap, /) -- Transform list into a heap, in-place, in O(len(heap)) time.heappushpop($module, heap, item, /) -- Push item on the heap, then pop and return the smallest item from the heap. The combined action runs more efficiently than heappush() followed by a separate call to heappop().heapreplace($module, heap, item, /) -- Pop and return the current smallest value, and add the new item. This is more efficient than heappop() followed by heappush(), and can be more appropriate when using a fixed-size heap. Note that the value returned may be larger than item! That constrains reasonable uses of this routine unless written as part of a conditional replacement: if item > heap[0]: item = heapreplace(heap, item)heappop($module, heap, /) -- Pop the smallest item off the heap, maintaining the heap invariant.heappush($module, heap, item, /) -- Push item onto heap, maintaining the heap invariant.;ģt$p^ܤTa,5n@0D$ĶhT@$zRx $FJ w?;*3$"D $X|=BKD hABzRx   H$`dDBBB B(D0A8D` 8A0A(B BBBA e8K0A(B BBB zRx `(С<HL|BBB B(A0A8D` 8A0A(B BBBH :H8BBB B(D0A8D` 8A0A(B BBBA ~H BBB B(A0A8GP 8A0A(B BBBK zRx P(HBBBB B(A0A8G` 8A0A(B BBBF `BBE B(A0A8D`\ 8A0A(B BBBA D 8K0A(B BBBE DʡHh&BBB B(A0A8D` 8A0A(B BBBA  0|ZBBA G0  DBBG zRx 0$9L0tP BEB B(A0A8Dy 8A0A(B BBBD $zRx ,eH8BBE B(A0A8D` 8A0A(B BBBG H~BBB B(A0A8G`p 8A0A(B BBBE X&4CCPL\r  C@Ho`P  X X oo8ooo X6FVfvP`c;P(lhP@3i3P#@lOP *jP@itP=i[Pp.`hP@hGA$3a1CGA$3a1CC_heapq.cpython-312-x86_64-linux-gnu.so-3.12.6-1.el8.x86_64.debugb7zXZִF!t/]?Eh=ڊ2N ٓXIZ}DAZdPXf~  敉[o"%F< {]55zL?Gğx"A^hD]Hd ,C$]!/"?ב81=3 W)iu/L&@=qÁЎ,q廗NcU7)21/UqHպ'"7Ya0TtL(?NCf;pbw`s723m?rWC #46YǍ6g4oؕi")o*E%!_`jams''JuWjM}N=I@LeS 5`-F k ru8 bp.X@')aWSm5tۈnTuݧ|'AzmZ[ စ}MՈ|g"~Lw:ZFWǭ$PôڬΔo N !Q .d@S]n K{ /2xej| J!wsN6*o! ǀۍb@U ]>TCOaX+VG{OsX=*  xr`S?ًyR;9*$^CI8/k/~2 ۸|IOC((.Fiz1MSlVBM0.`%/Nlo5N>[v#' 61VX|I"j ޙ_ gdn2zb?Vy[[=No&PR~Qg=aZuOL4 a+o x[2# c3XhS!pV#\xPX l>ˍƌ8&GSUfj67^h;@@[ L+TiOEƥkKz!r9=Q!q.gYZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata 88$o``$( 0PP8o&Eo88 TXX^B hc  n2tCC zPP mmmm|@@}HH}PP}XX}XX H(Hp