please provide a complete (more than just 4 pictures) explanation of a linked list with less programming.

Posted on 2014-08-13
Last Modified: 2014-08-15
what is a real world (less programming) explanation of a linked list?
Question by:rgb192
    LVL 32

    Accepted Solution

    is it homework? I will try a simple explanation not using pictures or code.

    a linked list is a container for arbitrary elements (for example strings or integers, but also complex class or structure elements) similar to an array.

    unlike to an array the elements are not placed side by side (en bloc) such that you could step from one to the next by adding the size of one element to the current position, but the elements are linked and each element may have an arbitrary location in memory. the link was made by adding a pointer to each element, what actually means that an element of a linked list actually is a pair of the real element and the pointer to the next pair. such a pair was called node and a linked list is a collection of nodes therefore. a node pointer also may be NULL what means that the end of list is reached. in a doubly linked list we have two pointers, one pointing to the next node and pointing back. the backwards pointer is NULL for the first node of a doubly linked list.

    in a linked list you can iterate by using the node pointer(s) to step from one node to the next (or previous) one. it is "cheap" to insert a new node anywhere into the list as you only have to change pointers. that is an advantage over other containers where you may have to move many elements to get a free space for the new element. a disadvantage of the linked list is that you (normally) don't have indexed access to the elements. to step to the nth element you always have to read all (n-1) nodes before.


    Author Closing Comment

    okay pointer can point to null or next


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    A short article about problems I had with the new location API and permissions in Marshmallow
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now