aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 = ();
}