C++ Unit-5 Link5sraararararraed List
C++ Unit-5 Link5sraararararraed List
For this, what we should do is ; when the list grows more memory
should be automatically allocated during run-time. Such situations
can be effectively handles by using DYNAMIC DATA STRUCTURES. One
such dynamic data structure is LINKED LIST.
LINKED LIST
LIST is a set of items organized sequentially.
Ex: array
Data field contains the value that is inserted and link field
contains the address of next preceding node.
We can divide the linked list into the following three types based
on the order of arrangement of nodes:
Say first is the first position in linked list. Let DATA be the element to be inserted in the
new node. POS is the position where the new node is to be inserted. TMP is a temporary
pointer to hold the node address. LEN is the number elements in the list. Len is initialized
to zero and first is initialized to NULL.