Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Priority-queue/Perl/priority-queue-1.pl
Normal file
15
Task/Priority-queue/Perl/priority-queue-1.pl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use feature 'say';
|
||||
use Heap::Priority;
|
||||
|
||||
my $h = Heap::Priority->new;
|
||||
|
||||
$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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue