Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Priority-queue/Picat/priority-queue-1.picat
Normal file
17
Task/Priority-queue/Picat/priority-queue-1.picat
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
main =>
|
||||
Tasks = [[3,"Clear drains"],
|
||||
[4,"Feed cat"],
|
||||
[5,"Make tea"],
|
||||
[1,"Solve RC tasks"],
|
||||
[2,"Tax return"]],
|
||||
Heap = new_min_heap([]),
|
||||
foreach(Task in Tasks)
|
||||
Heap.heap_push(Task),
|
||||
println(top=Heap.heap_top())
|
||||
end,
|
||||
nl,
|
||||
println(Heap),
|
||||
println(size=Heap.heap_size),
|
||||
nl,
|
||||
println("Pop the elements from the queue:"),
|
||||
println([Heap.heap_pop() : _ in 1..Heap.heap_size]).
|
||||
Loading…
Add table
Add a link
Reference in a new issue