Heap::...NumRev(3pm)
π Heap::...NumRev(3pm) π
okay so welcome to the Heap::...NumRev page, bestie πΈ this one lives in the User Contributed Perl Documentation section of the manual (yes that's the manual name, we're being official for like two seconds) β¨
π¦ NAME π¦
Heap::Elem::NumRev β Reversed Numeric Heap Elements π
β¨ SYNOPSIS β¨
use Heap::Elem::NumRev( NumRElem );
use Heap::Fibonacci;
my $heap = Heap::Fibonacci->new;
my $elem;
foreach $i ( 1..100 ) {
$elem = NumRElem( $i );
$heap->add( $elem );
}
while( defined( $elem = $heap->extract_top ) ) {
print "Largest is ", $elem->val, "\n";
}
π DESCRIPTION π
okay so Heap::Elem::NumRev is literally here to wrap numeric values up into an element, so that element can get managed on a heap π«Ά and the top of the heap is gonna have the largest element still remaining. no cap. biggest one first, always π
π and if that's not the vibe you're going for? if you want the heap to always hand you the smallest element instead? go read Heap::Elem::Num, bestie. that's the one for you.
the deets on the Elem interface? they're all described over in Heap::Elem β¨
and the deets on actually using a Heap interface? those live in Heap πΈ
π AUTHOR π
John Macdonald, john@perlwolf.com π
π COPYRIGHT π
Copyright 1998-2007, O'Reilly & Associates.
This code is distributed under the same copyright terms as perl itself β
π«Ά SEE ALSO π«Ά
Heap(3)Heap::Elem(3)Heap::Elem::Num(3)
and that's the whole page, bestie, we ate π it's giving perl v5.36.0, dated 2022-10-22, and that footer is the last line so we're outtie β bye, ily, go heap responsibly π§π
π¦ where this page comes from
- ubuntu noble: libheap-perl 0.80-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libheap-perl 0.80-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libheap-perl 0.80-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms