Heap::Elem::Num(3pm) User Contributed Perl Documentation Heap::Elem::Num(3pm)NAME
Heap::Elem::Num - Numeric Heap Elements
SYNOPSIS
use Heap::Elem::Num( NumElem );
use Heap::Fibonacci;
my $heap = Heap::Fibonacci->new;
my $elem;
foreach $i ( 1..100 ) {
$elem = NumElem( $i );
$heap->add( $elem );
}
while( defined( $elem = $heap->extract_top ) ) {
print "Smallest is ", $elem->val, "
";
}
DESCRIPTION
Heap::Elem::Num is used to wrap numeric values into an element that can be managed on a heap. The top of the heap will have the smallest
element still remaining. (See Heap::Elem::NumRev if you want the heap to always return the largest element.)
The details of the Elem interface are described in Heap::Elem.
The details of using a Heap interface are described 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::NumRev(3).
perl v5.8.8 2007-10-23 Heap::Elem::Num(3pm)
Check Out this Related Man Page
Heap::Elem::NumRev(3pm) User Contributed Perl Documentation Heap::Elem::NumRev(3pm)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, "
";
}
DESCRIPTION
Heap::Elem::NumRev is used to wrap numeric values into an element that can be managed on a heap. The top of the heap will have the largest
element still remaining. (See Heap::Elem::Num if you want the heap to always return the smallest element.)
The details of the Elem interface are described in Heap::Elem.
The details of using a Heap interface are described 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).
perl v5.8.8 2007-10-23 Heap::Elem::NumRev(3pm)
I'm a new guy to this field and I'm learning a lot about UNIX! Can any explan to me what exactly does 'heap size' mean and how can i increase the size for AIX 4.3.3? (2 Replies)
I understand this question probably poses some child like stupidity, but I can't get this if statement to work for love or money.
#!/bin/ksh
echo "Input either 1 or 2"
read Num
if ; then
echo "Message 1"
if ; then
echo "Message 2"
else
echo "false"
fi
$ ksh decisions
Input either 1... (6 Replies)
Hi.
I have a qury whihc I hope someone could clarify.
I have a file:-
Num Measure
108 0.05
12 0.45
13 0.2
19 0.5
I wanted to grep the value of 19 from Column Num which will then take the minimum value of measure (not including 19's measure value).... (3 Replies)
Hi,
I have a basic doubt here.
Consider the following code snippet:
main()
{
int *a;
.
.
}
Here the memory for a gets allocated in heap or stack. (5 Replies)
Hi Friends,
i need a unix command to check the heap space availability on unix system as I am getting following error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error occurred during initialization of VM
Could not reserve enough space for... (2 Replies)
Hi,
I cant seem to figure out how I add a character to an existing one. Heres my problem.
So I have a line that looks like this:
>56
584848392394958586858484849393
What I want to do is add Num in front of the 56. So basically I want to recognize the > and add Num in front of the... (6 Replies)
Hello all,
I need a positive reply from you.
I want to copy the user-process-heap to the kernel space memory.
For that, I wrote the following code but it does not copy.
---------------- code --------------
unsigned long length_of_heap_vma = < length of vma pointing to process-heap > ;
void *... (2 Replies)
Hi all,
I have a huge csv file with the following format of data,
Num SNPs, 549997
Total SNPs,555352
Num Samples, 157
SNP, SampleID, Allele1, Allele2
A001,AB1,A,A
A002,AB1,A,A
A003,AB1,A,A
...
...
...
I would like to write out a list of unique SNP (column 1). Could you... (3 Replies)
Hi everybody, i am doing a project on checkpoints, where in i need to write the heap area into a file. I have got a code which i need to analyze, also asked in the forum under solaris
https://www.unix.com/solaris/135483-libckpt.html
The heap is implemented as a link list given by the structure... (2 Replies)
Hello,
I am working on solving an NP-Complete problem, so it is very important that operations and data with limited integer-argument ranges be computed using immutable look-up-tables contained entirely in CPU cache. Retrieval of the look-up-table data must never leave the CPU once initially... (6 Replies)
Hi,
Can anyone help:
I want to get the 7th column of a file seperated by ^
Num:^ 1^ testdevice1^10.1.1.1^PT1X23^true^HD^175^up^false^bad
Num:^ 2^ testdevice2^10.1.1.2^ST1X23^true^SN^175^up^false^bad
Expected result:
HD
SN
Appreciate your help. (2 Replies)
i'm using the below perl code to get a list of ips:
my @allipsfound ;
for my $elem (@gatches) {
my ($ip) = split ":",$elem;
print "$ip \n";
}
it spits out several lines of ips. most of those ips are the same. how do i do sort and uniq in the above code to make it so that it only... (3 Replies)
Hello, I am a beginner to shell programming. Coded the following for Fibonacci series.
#!/bin/bash
fib() {
i=0
j=1
arr=0
arr=1
echo "enter the limit:"
read n
while
do
fo= expr $j - 1
f1=$j
f2= expr $j + 1
arr= expr ${arr} + ${arr}
echo ${arr} (3 Replies)