You are on page 1of 2

Linked List

Linked list is a very flexible, dynamic data structure in which the elements called nodes
form a sequential list. Unlike arrays, linked lists do not have a fixed size. They can grow,
whenever they need to accommodate more elements. Each node contains the following
types of data
1. A value that is stored in that node
2. A pointer or link to the next node in the list. The pointer actually contains the address of
the next element.
A single node looks like the following:

20 0x1035
The last node contains a null pointer to indicate that it is the end or the tail of the list. The
layout of a linked list is shown below.
0x000 0x000 0x000 0x000 0x000 0x000 0x000 0x000 2-0x00
1 2 3 4 5 6 7 8 16
0x001 12-0x0 20-0x1 0x001 0x001 0x001 3-0x00 0x001 0x001
0 050 035 3 4 5 72 7 8
0x001 0x002 0x002 0x002 0x002 0x002 0x002 0x002 0x002
9 0 1 2 3 4 5 6 7
0x002 0x002 0x003 0x003 0x003 0x003 0x003 32-0x0 5-NUL
8 9 0 1 2 3 4 057 L
0x003 0x003 0x003 0x004 0x004 0x004 0x004 0x004 0x004
7 8 9 0 1 2 3 4 5
0x004 0x004 0x004 0x004 2- 0x005 0x005 0x005 0x005
6 7 8 9 0x006 1 2 3 4
1
0x005 0x005 25-0x0 0x005 0x005 0x006 15-0x0 0x006 0x006
5 6 011 8 9 0 009 2 3
0x006 0x006 0x006 0x006 0x006 0x006 0x007 0x007 30-0x0
4 5 6 7 8 9 0 1 036

The possible operations with an array are, storing the elements, accessing or reading the
elements, inserting elements and deleting elements.
The characteristics of a linked list are as follows:
● Linked lists are dynamic in size; they can grow as required.
● Memory for the elements are dynamically created as and when they are added to the
list.
● Memory allocation need not be contiguous.
● Elements are stored as nodes which contain the value of the element and the
address of the next element.
● All elements are of the same data type
● Elements can be randomly accessed.
● Easier to insert or delete data elements
● Searching an element is slow.
● Requires more storage space.

You might also like