GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ALGORITHM::MINMAX (3)

.ds Aq ’

NAME

Algorithm::MinMax - Finding the minimum and maximum of an array with at most 3n/2 - 2 comparisons.

CONTENTS

SYNOPSIS



  use Algorithm::MinMax;
  @a = ( 3, 2, 5, 4, 8, 9 );
  @r = Algorithm::MinMax->minmax( \@a );

  # $r[0] = minimum = 2
  # $r[1] = maximum = 9



DESCRIPTION

The implementation finds the minimum and maximum of a given array with at most 3n/2 - 2 comparisons, where n is the number of elements of the array.

RETURN

Returns an array where the first entry is the minimum and the second entry the maximum of the given array.

If minmax is called with an empty array, minmax will also return an empty array.

AUTHOR

Daniel Etzold, detzold@gmx.de
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MINMAX (3) 2003-05-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.