Thread: Functionality of Linked Lists

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    17

    Question Functionality of Linked Lists

    I understand the mechanics of simple linked lists, but the only functionality for them that I have seen exemplified is that of sorting values(e.g., input 13, 4, 8, output 4,8,13). I know that there must be some much more powerful function that LL's can serve, but what?

    Thanks.
    "None are more hopelessly enslaved than those who falsely believe they are free."
    -Goethe

    [paraphrased] "Those who would sacrifice essential liberties for a little temporary safety deserve neither."
    -Benjamin Franklin

  2. #2
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    They are great for things that dynamically resize themselves, like strings that can grow, shrink, be cut up, etc.

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    17

    Smile

    Oh okay, cool, but could you possibly explain what you mean by "cutting up" strings? Thanks.
    "None are more hopelessly enslaved than those who falsely believe they are free."
    -Goethe

    [paraphrased] "Those who would sacrifice essential liberties for a little temporary safety deserve neither."
    -Benjamin Franklin

  4. #4
    Registered User
    Join Date
    Jan 2004
    Posts
    33
    Parsing a string. I.e. taking "This is a string" and turning it into several strings. ("This", "This is a", Thi", "a stri" etc)
    “Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. " -John Carmack

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    17
    Ahh yes I had suspected that one could do this, but how exactly?
    "None are more hopelessly enslaved than those who falsely believe they are free."
    -Goethe

    [paraphrased] "Those who would sacrifice essential liberties for a little temporary safety deserve neither."
    -Benjamin Franklin

  6. #6
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Originally posted by MisterWonderful
    Ahh yes I had suspected that one could do this, but how exactly?
    dont you think your are jumping from one topic to the other...


    Answerinf your original questions:-


    Linked lists are used in Databases in the form as B Trees or B+ trees... Without them the database would be really slow... Now dont ask him how B trees are used in Databases

  7. #7
    Registered User
    Join Date
    Apr 2003
    Posts
    17
    Haha sorry I suppose I am too curious for my own good
    "None are more hopelessly enslaved than those who falsely believe they are free."
    -Goethe

    [paraphrased] "Those who would sacrifice essential liberties for a little temporary safety deserve neither."
    -Benjamin Franklin

  8. #8
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I suppose I am too curious for my own good
    There's no such thing when it comes to computers. But if you haven't worked with linked data structures much, you'll have a lot of trouble with B-trees. So I agree with vasanth.

    To answer your original question you would use a variant of a linked list if you need a data structure that can grow and shrink efficiently from anywhere in the data set, can be restructured with minimal effort, and (usually, but not always) can be searched efficiently.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Singly Linked Lists: Clarification Needed
    By jedispy in forum C++ Programming
    Replies: 4
    Last Post: 12-14-2006, 05:30 PM
  2. Linked Lists 101
    By The Brain in forum C++ Programming
    Replies: 5
    Last Post: 07-24-2004, 04:32 PM
  3. Map file formats and linked lists
    By Spitball in forum Game Programming
    Replies: 2
    Last Post: 03-04-2004, 11:32 PM
  4. need help w/ linked lists
    By MKashlev in forum C++ Programming
    Replies: 11
    Last Post: 08-05-2002, 08:57 PM
  5. doubly linked lists
    By qwertiop in forum C++ Programming
    Replies: 3
    Last Post: 10-03-2001, 06:25 PM