Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Efficient Linked Lists

by dpuu (Chaplain)
on Jan 31, 2003 at 20:26 UTC ( #231705=note: print w/ replies, xml ) Need Help??


in reply to Efficient Linked Lists

I'm not sure that its more efficient, but you could try:
# create pairs my @tmp = map { $_, $_ } @filenames; # rotate push @tmp, shift @tmp; # create the result my %next = @tmp; my %prev = reverse @tmp;
In this code, the hashes form loops: to avoid that, replace the rotate step by code that remove the first and last elements. --Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://231705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2016-06-28 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (350 votes). Check out past polls.