03-module-05
03-module-05
LINKED LISTS
Suppose that the items of an array were explicitly ordered i.e. each item contained
within itself the address of the next element. Such an explicit ordering gives rise to a
data structure known as a Linear linked list as shown in the figure below.
Each item in the list is called a node and it contains two fields.
i) Information field: It holds the actual element on the list.
ii) The next address field: It contains the address of the next node in the list.
Such an address, which is used to access a particular node, is known as a
pointer.
The entire linked list is accessed from an external pointer list that points to
(contains the address of) the first node in the list.
The next address field of the last node in the list contains a special value called
null. This is not a valid address and is used to signal the end of a list.
The list with no nodes on it is called the empty list or the null list. The value of the
external pointer list to such a list is the null pointer. A list can be initialized to the
empty list by the operation list = null.
GATE/CS/DSA/SLP/Ch.1_Notes/Pg.2