Priority queue: Difference between revisions
Added 11l
Alextretyak (talk | contribs) (Added 11l) |
|||
Line 30:
You may choose to impose certain limits such as small range of allowed priority levels, limited capacity, etc. If so, discuss the reasons behind it.
<br><br>
=={{header|11l}}==
{{trans|Python}}
<lang 11l>V items = [(3, ‘Clear drains’), (4, ‘Feed cat’), (5, ‘Make tea’), (1, ‘Solve RC tasks’), (2, ‘Tax return’)]
minheap:heapify(&items)
L !items.empty
print(minheap:pop(&items))</lang>
{{out}}
<pre>
(1, Solve RC tasks)
(2, Tax return)
(3, Clear drains)
(4, Feed cat)
(5, Make tea)
</pre>
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
Line 415 ⟶ 432:
Priority : 5 : Make tea
</pre>
=={{header|Ada}}==
{{works with|Ada 2012}}
|