aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaldhar H. Vyas <jaldhar@braincells.com>2019-08-03 18:30:57 -0400
committerJaldhar H. Vyas <jaldhar@braincells.com>2019-08-03 18:30:57 -0400
commit95e5e5819dd5918d511bd4adce79e56058696b02 (patch)
tree3c735342065f5fb4a3194d1b7fb0ddc43794078f
parentbf253d6c6df7dabe03e84a10ccf6041f392e4bc9 (diff)
downloadperlweeklychallenge-club-95e5e5819dd5918d511bd4adce79e56058696b02.tar.gz
perlweeklychallenge-club-95e5e5819dd5918d511bd4adce79e56058696b02.tar.bz2
perlweeklychallenge-club-95e5e5819dd5918d511bd4adce79e56058696b02.zip
Challenge 18 by Jaldhar H. Vyas: minor typo/bug fixes to problem 2.
-rwxr-xr-xchallenge-018/jaldhar-h-vyas/perl5/ch-2.pl10
-rwxr-xr-xchallenge-018/jaldhar-h-vyas/perl6/ch-2.p62
2 files changed, 3 insertions, 9 deletions
diff --git a/challenge-018/jaldhar-h-vyas/perl5/ch-2.pl b/challenge-018/jaldhar-h-vyas/perl5/ch-2.pl
index 826279354d..f8f01c544e 100755
--- a/challenge-018/jaldhar-h-vyas/perl5/ch-2.pl
+++ b/challenge-018/jaldhar-h-vyas/perl5/ch-2.pl
@@ -44,14 +44,9 @@ data structure where the items are sorted in order of numeric priority.
=cut
-has _iterator => (
- is => 'rw',
- default => 0,
-);
-
has _queue => (
is => 'rw',
- default => sub { [] } # should use a binary heap really but its all good...
+ default => sub { [] }
);
has _size => (
@@ -63,7 +58,7 @@ has _size => (
=head3 clear()
- removes all elements from the priority queue and resets iteration.
+ removes all elements from the priority queue.
=cut
@@ -72,7 +67,6 @@ sub clear {
$self->_queue([]);
$self->_size(0);
- $self->_iterator(0);
}
=head3 top()
diff --git a/challenge-018/jaldhar-h-vyas/perl6/ch-2.p6 b/challenge-018/jaldhar-h-vyas/perl6/ch-2.p6
index 693066c50f..91718af12e 100755
--- a/challenge-018/jaldhar-h-vyas/perl6/ch-2.p6
+++ b/challenge-018/jaldhar-h-vyas/perl6/ch-2.p6
@@ -9,7 +9,7 @@ class Data::PriorityQueue {
has Element @!queue = ();
- method clear {
+ method clear() {
@!queue = ();
}