RosettaCodeData/Task/Priority-queue/Nim/priority-queue-2.nim

13 lines
234 B
Nim
Raw Permalink Normal View History

2018-06-22 20:57:24 +00:00
import HeapQueue
2016-12-05 23:44:36 +01:00
2018-06-22 20:57:24 +00:00
var pq = newHeapQueue[(int, string)]()
2016-12-05 23:44:36 +01:00
2018-06-22 20:57:24 +00:00
pq.push((3, "Clear drains"))
pq.push((4, "Feed cat"))
pq.push((5, "Make tea"))
pq.push((1, "Solve RC tasks"))
pq.push((2, "Tax return"))
2016-12-05 23:44:36 +01:00
2018-06-22 20:57:24 +00:00
while pq.len() > 0:
echo pq.pop()