1Heap::Elem::StrRev(3) User Contributed Perl DocumentationHeap::Elem::StrRev(3)
2
3
4

NAME

6       Heap::Elem::StrRev - Reversed String Heap Elements
7

SYNOPSIS

9         use Heap::Elem::StrRev( StrRElem );
10         use Heap::Fibonacci;
11
12         my $heap = Heap::Fibonacci->new;
13         my $elem;
14
15         foreach $i ( 'aa'..'bz' ) {
16             $elem = StrRElem( $i );
17             $heap->add( $elem );
18         }
19
20         while( defined( $elem = $heap->extract_top ) ) {
21             print "Largest is ", $elem->val, "\n";
22         }
23

DESCRIPTION

25       Heap::Elem::StrRev is used to wrap string values into an element that
26       can be managed on a heap.  The top of the heap will have the largest
27       element still remaining.  (See Heap::Elem::Str if you want the heap to
28       always return the smallest element.)
29
30       The details of the Elem interface are described in Heap::Elem.
31
32       The details of using a Heap interface are described in Heap.
33

AUTHOR

35       John Macdonald, john@perlwolf.com
36
38       Copyright 1998-2007, O'Reilly & Associates.
39
40       This code is distributed under the same copyright terms as perl itself.
41

SEE ALSO

43       Heap(3), Heap::Elem(3), Heap::Elem::Str(3).
44
45
46
47perl v5.34.0                      2022-01-21             Heap::Elem::StrRev(3)
Impressum