Data Structures: Class Lecture-4
Data Structures: Class Lecture-4
Class Lecture-4
08/15/20 2
Array
Let LA be a linear array in the memory of the
computer.
• LA are stored in successive memory cells.
Accordingly, the computer does not need to
keep track of the address of every element of
LA, but needs to keep track only of the
address of the first element of LA denoted by
Base(LA).
08/15/20 3
Array
LOC (LA[K]) = address of the element LA[K] of
the array LA
LOC (LA[K]) = Base (LA) + w(K-lower bound)
Where, w is the number of words per memory cell for
the array LA.
08/15/20 4
Array
LOC (LA[K]) = Base (LA) + w(K-lower bound)
Auto is the array.
Base, [AUTO] =200, w = 4
LOC (Auto[1932]) = 200
LOC (Auto[1933]) = 204
LOC (Auto[1934]) = 208
08/15/20 5
Linked List
• Linked List is Series of Nodes
• Each node Consist of two Parts viz Data Part & Pointer Part
• Pointer Part stores the address of the next node
08/15/20 6
Linked List
08/15/20 7
Array Vs Linked List
Figure it yourself
8
Thank You