element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Code Exchange
  • Technologies
  • More
Code Exchange
Forum What are the applications of Linked Lists?
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 19 replies
  • Subscribers 50 subscribers
  • Views 2033 views
  • Users 0 members are here
  • Code Exchange
  • c++
Related

What are the applications of Linked Lists?

Former Member
Former Member over 11 years ago

I just wanted to know where i can apply the concept of linked lists, or what kind of program requires linked lists application. If any body can help me, I will appreciate.

  • Sign in to reply
  • Cancel
  • jadew
    0 jadew over 11 years ago

    A bit of a late reply, but here it is.

     

    Inserting an element inside a linked list is as simple as assigning the previous node's "next" property to point to this new element and the "next" property of this element to whatever the previous node's "next" was pointing to.

     

    elm->next = prev->next;

    prev->next = elm;

     

    Removing an element from the list is equally light:

     

    prev->next = elm->next;

     

    If you had a std::vector for example, all the elements after the insertion or deletion position would have had to be moved and possibly a new block allocated to fit the new size of the vector (the vector guarantees that all the elements are one after the other in memory).

     

    The downside is that if you want to access the n-th element, you'll have to go trough all the elements before it.

     

    To answer your question: you go for linked lists when you care more about insertion and deletion performance, than for random access.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to jadew

    Thanks for the replay, I appreciate.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • phoenixcomm
    0 phoenixcomm over 11 years ago

    why do you wish to use a "linked-list"?? "linked-lists" comes in many flavors, FIFO (First-In-First-Out), FILO, LIFO. A FIFO in real life would be a plate holder in your cafeteria. ie the one on top is always first. You can find out more in any good college text dealing with "Data Structures" some are very practical and some show you the math behind them.. I like C & Data Structures (P.S. Desbpande) or if you really want more look through Fundamental Algorithms (D. Knuth) its a 4 volume set.. hey I survived volume 1.  

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 11 years ago in reply to Former Member

    Try this:

     

    Linked list - Wikipedia, the free encyclopedia

     

    @Christina - A FILO implented as a linked list will make your brain hurt - since you would have to traverse the list backwards.

     

    The plate holder is a FILO - First In (at the bottom of the pile) is Last Out, the plate holder is most often used as a stack illustration.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jadew
    0 jadew over 11 years ago in reply to michaelkellett

    There's nothing wrong with a FILO container implemented as a linked list, in fact it's the preferred approach. The elements can always point both ways so there's no trouble with that.

     

    Razvan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 11 years ago in reply to jadew

    Well, yes and no, to work as  a FILO you need to be a Doubly or Multiply linked list which isn't quite the same thing. (I'm not sure how frequently the distinction is made.)

     

    Of course, since I "code" more in VHDL than anything else the idea of linked lists is pretty abhorent to me - I'm used to FIFOs that can provide one result per clock cycle - containers sound like something from the OOP world image

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • phoenixcomm
    0 phoenixcomm over 11 years ago in reply to michaelkellett

    duh, brain fart your quite right... almost never use them..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • phoenixcomm
    0 phoenixcomm over 11 years ago in reply to michaelkellett

    there is not distinction between single or double linked list.. they are all inclusive.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • phoenixcomm
    0 phoenixcomm over 11 years ago in reply to michaelkellett

    nope they were here before OOP.. They where here in BASIC (Dartmouth), and FORTRAN (well before 77)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • D_Hersey
    0 D_Hersey over 11 years ago

    I use them almost whenever I cannot anticipate how big my data is going to grow.  They are especially convenient when my elements can be of variable size.  I nest them pretty deeply and bizarrely when  am coding graftals.  The coming of STL has made them almost as easy as a regular-old data type.  Vector is a type that is internally dynamic, but allows for integer indexing.  This allows for the ease of an array for a linked type.  I use doubly-linked ones if my traversals are as likely to be backward as forward.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube