0% found this document useful (0 votes)
16 views

Data Structures: Class Lecture-4

The document discusses arrays and linked lists. It defines a linear array as a list of homogeneous data elements stored in successive memory locations. It explains that only the address of the first array element needs to be tracked, and other element addresses can be calculated from that. Linked lists are defined as a series of nodes, where each node contains data and a pointer to the next node.

Uploaded by

Zakir Hossen
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Data Structures: Class Lecture-4

The document discusses arrays and linked lists. It defines a linear array as a list of homogeneous data elements stored in successive memory locations. It explains that only the address of the first array element needs to be tracked, and other element addresses can be calculated from that. Linked lists are defined as a series of nodes, where each node contains data and a pointer to the next node.

Uploaded by

Zakir Hossen
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 9

Data Structures

Class Lecture-4

Mohammad Ashraful Islam


Lecturer
Department of CSE, JU
08/15/20 1
Array
A linear array is a list of a finite number of
homogeneous data elements.
The elements of the array are stored and respectively
in successive memory locations. The number n of
elements is called the length or size of array. 
Length, N = UB - LB + 1
UB :The upper bound (UB) of the index range.
LB: lower bound (LB) of the index range.

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

You might also like