Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Priority-queue/D/priority-queue.d
Normal file
15
Task/Priority-queue/D/priority-queue.d
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import std.stdio, std.container, std.array, std.typecons;
|
||||
|
||||
void main() {
|
||||
alias tuple T;
|
||||
auto heap = heapify([T(3, "Clear drains"),
|
||||
T(4, "Feed cat"),
|
||||
T(5, "Make tea"),
|
||||
T(1, "Solve RC tasks"),
|
||||
T(2, "Tax return")]);
|
||||
|
||||
while (!heap.empty) {
|
||||
writeln(heap.front);
|
||||
heap.removeFront();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue