Array-Heap-ModifiablePriorityQueue

 view release on metacpan or  search on metacpan

lib/Array/Heap/ModifiablePriorityQueue.pm  view on Meta::CPAN

=over 4

=item Array::Heap::ModifiablePriorityQueue->new()

Create a new, empty priority queue.

=cut

sub new {
   my ($class) = @_;
   return bless { heap => [], items => {} } => $class;
}

=item $pq->add($item, $weight)

Add an item to the priority queue with the given weight. If the item is
already present in the queue, modify its weight. Weight must be numeric.

=cut

sub add {

lib/Array/Heap/PriorityQueue/Numeric.pm  view on Meta::CPAN

=over 4

=item Array::Heap::PriorityQueue::Numeric->new()

Create a new, empty priority queue.

=cut

sub new {
   my ($class) = @_;
   return bless [ ] => $class;
}

=item $pq->add($item, $weight)

Add an item to the priority queue with the given weight. Weight must be
numeric, and defaults to item.

=cut

sub add {

lib/Array/Heap/PriorityQueue/String.pm  view on Meta::CPAN

=over 4

=item Array::Heap::PriorityQueue::String->new()

Create a new, empty priority queue.

=cut

sub new {
   my ($class) = @_;
   return bless [ ] => $class;
}

=item $pq->add($item, $weight)

Add an item to the priority queue with the given weight. Weights are
compared as strings (lexicographically), and default to item.

=cut

sub add {

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.004 second using v1.00-cache-1.14-grep-28634ff-cpan-207214f8fbd )