Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to implement Linked List

by GrandFather (Cardinal)
on Dec 18, 2006 at 19:50 UTC ( #590541=note: print w/ replies, xml ) Need Help??


in reply to How to implement Linked List

Perl already has linked lists in effect, they are (as others have suggested) called arrays. The key to unlocking Perl arrays as linked lists is to know about splice. Perl arrays are not constant time node insertion and deletion, but are likely to be fast enough for most purposes and splice is easier to read than a bunch of code fooling around with the 'pointers' a linked list requires.


DWIM is Perl's answer to Gödel


Comment on Re: How to implement Linked List

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-09-20 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls