Santosh Kumar Nayak wrote:What is the internal Implementation of Linked List ?
Very simply, it's based on "Nodes" that point to each other, viz:
It doesn't show the whole implementation, but that's the basic structure for a doubly-linked list; for a single-linked list you just remove the '
prev' pointer.
To "insert" values, you simply change the pointers so that "neigbours" point to a new Node, and to remove one you change its neighbours so that they point to each other. It's a bit fiddly at first - especially with doubly-linked Nodes - but you'll soon get the hang of it.
There's quite a good set of diagrams in the
Wiki page on the subject, which may also help you to work out what's going on.
HIH
Winston