I understand the definition of a Linked List, but how can it be represented and related to a common concept or item?
For example, composition (EDIT: originally said 'inheritance') in OOP can be related to automobiles. All (most) automobiles in real life are the essentially same thing; an automobile has an Engine, you can start() it, you can make the car go(), stop() and so on. An automobile would typically have a maximum passenger capacity but it would differ between a Bus and a SportsCar, which are both automobiles.
Is there some real life, intuitive example of the plain ole' singly Linked List like we have with inheritance? The typical textbook Linked List example shows a node with an integer and a pointer to the next, and it just doesn't seem very useful.
Your input is appreciated.
My first reaction to this question was "Look around! This stuff is everywhere!" But after thinking about it for a bit, I couldn't think of any example that isn't contrived.
The concept of a linked list is a compound concept, a two-fer. You have the notion of a list, which is no problem. A grocery list, for example. Then you get to the link part. One grocery item doesn't know about the next grocery item, so the model breaks down.
I think that the reason you are having trouble with finding a real world eample is that the link part is a programming artifact, an implementation detail. There are many ways to implement lists programatically and one good way is to have each list item know about its neighbors. Another way is to have a List object that keeps track of the items and their order. This is how most lists work in real life. In the example above, the List object for the grocery list would be the paper (or whatever) it's written on.
Maybe it's more useful to think about lists in general and view linked lists as just a specific implementation of a list.
A good example of a linked list is your text message, wherein a certain packet a message may be divided into several packets. Each packet holds a key which connects to the next key and to the n-th key to make the whole text message wherein it contains the key and the data.
Some example of single linked list.
Some example of double linked list.
The way Blame moves around a bunch of software engineers working on different modules in a project.
First, the GUI guy gets blamed for the product not working. He checks his code and sees it's not his fault: the API is screwing up. The API guy checks his code: not his fault, it's a problem with the logger module. Logger module guy now blames database guy, who blames installer guy, who blames...
Your DNA molecules are double-linked lists.
well if a teacher took his students to a cartoon movie but she couldn't get the seats together, she'll ask students to remember the address(seat number) of next student and so on... so that she wouldn't have to face the trouble while going back!!!