tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
14
Task/Priority-queue/Perl/priority-queue-1.pl
Normal file
14
Task/Priority-queue/Perl/priority-queue-1.pl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use 5.10.0;
|
||||
use strict;
|
||||
use Heap::Priority;
|
||||
|
||||
my $h = new Heap::Priority;
|
||||
|
||||
$h->highest_first(); # higher or lower number is more important
|
||||
$h->add(@$_) for ["Clear drains", 3],
|
||||
["Feed cat", 4],
|
||||
["Make tea", 5],
|
||||
["Solve RC tasks", 1],
|
||||
["Tax return", 2];
|
||||
|
||||
say while ($_ = $h->pop);
|
||||
5
Task/Priority-queue/Perl/priority-queue-2.pl
Normal file
5
Task/Priority-queue/Perl/priority-queue-2.pl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Make tea
|
||||
Feed cat
|
||||
Clear drains
|
||||
Tax return
|
||||
Solve RC tasks
|
||||
Loading…
Add table
Add a link
Reference in a new issue