Ds Unit 3
Ds Unit 3
A Linked Organization is one in which the elements of the list are logically next to each other, but
physically, they may not be adjacent.
linked representation” or “linked organization "should be used, i.e. unlike an array, where elements
are stored sequentially in memory, items in a list may be located anywhere in memory.
To access elements in the correct order, we store the address or location of the next element, with
each element of the list
Data next
Data next
Data Next
5 7 9 Null
Head
Null 10 20 30 Null
Head
Data Next
5 7 9
Head
5 7 9 Null
Head
2 3
4 5
Top 9
7 5 7 9 19
Front rear
5
Data/
flag next
Link
Flag can have either any of the following values:
1. Flag 0 indicates: Node Containing Data
2. Flag 1 indicates: Node Containing Link
Middle portion of node may have either data or down link to sub list.
Next part will point to next element in list.
0 a 0 b 0 c 1 NULL
Head
0 d 0 e 1 0 g NULL
0 f NULL
Variable
flag next
/Link
0 Variable
1 Link
Coeff/
flag Expo next
Link
1. Coeff is present
2. Link is present
0 X 2 2 2 1 NULL
0 Y 2 1 0 Y 1 5 1 NULL
NULL
0 Z 1 3 1 NULL