Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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?
NodeReaper does the danse macabre

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2017-02-21 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (318 votes). Check out past polls.