Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

TIMTOWTDI and other languages

by Ovid (Cardinal)
on Apr 28, 2002 at 20:35 UTC ( #162711=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    }
    @results = sort { $a <=> $b } @results;
    print "Linear search: @results\n";
    
  2. or download this
    my @alphas = qw/ 9 4 3 2 22  13 7  140 95 278/;
    my @betas  = qw/ 8 3 4 1 278 94 15 7   19 200/;
    ...
    
    @results = sort { $a <=> $b } @results;
    print "Hash lookup:   @results\n";
    
  3. or download this
    my @alphas = qw/ 9 4 3 2 22  13 7  140 95 278/;
    my @betas  = qw/ 8 3 4 1 278 94 15 7   19 200/;
    ...
            return undef;
        }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://162711]
Approved by robin
Front-paged by robin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-04-27 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (495 votes), past polls