Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Linked-list Style Data Structure

by impossiblerobot (Deacon)
on Oct 07, 2002 at 13:06 UTC ( [id://203313]=note: print w/replies, xml ) Need Help??


in reply to Re: Linked-list Style Data Structure
in thread Linked-list Style Data Structure

Thanks, Abigail-II, for pointing out the vagueness in my question. The specific functionality that I am looking for at this point is essentially as you stated:

  • The ability to define the data structure simply (preferably using an array or list).
  • The ability to find out the name of the next or previous item based on the the current (or a named) item.

Although I currently do not need to insert or delete elements, I might need to in the future. However, since my lists will never be that long, and I would not do it that often, I could probably still use your suggestion (and rebuild the entire index when necessary) without any noticable performance issues.

In any case, it seems that you are advocating trying to use a data structure appropriate to the task, rather than relying on a generic structure that might be less suited. Am I understanding correctly?


Impossible Robot

Replies are listed 'Best First'.
Re: Linked-list Style Data Structure
by Abigail-II (Bishop) on Oct 07, 2002 at 14:12 UTC
    In any case, it seems that you are advocating trying to use a data structure appropriate to the task, rather than relying on a generic structure that might be less suited. Am I understanding correctly?
    Yes, that's the Perl (and Unix) way. You have a large toolkit at your disposal, with lots of different tools. Different tools for different jobs. Use your toolkit. The saying "if all you have is a hammer, everything looks like a nail" is not at all appropriate for Perl.

    Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-28 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found