tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 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