2) Types of Data Structure
2) Types of Data Structure
1
1 & 2) Logical & Physical Data structure
●
When abstract data type is implmented it is called
as physical data structure.
●
All logical relationships & operations are
maintained.
2
3) Primitive Data structure
●
Primitive data structures are those which are
already implemented & built-in into language
●
Data objects consist of a single unit of
●
information & do not contain any sub parts
Internal representation of data object is fixed
for specific machine & may vary from one to
● another.
3
4) Non Primitive Data Structure
● It is derived from(made) primitive data
● structure They have lots of units of
● information
It contains group of similar or different data
●
elements.
4
5) Linear Data structure
●
Elements of LDS are arranged in line. They
form a sequence or a list
●
There is a ordering among them such as first
●
element, second element & so on.
Their mapping is one dimensional
●
5
Example 1. Array
●
Array is a collection of similar data elements
in sequntial memory location and it is refer
by common name.
●
int a[ 5 ];
a 10 2 3 4 5
0 0 0 0
6
Example 2. Linked List
● It is a collection of same data type
●
But it does not require sequential
memory locations to store the data
7
6) Non Linear data
structure
● Data is not stored in linear manner
●
Elements have one to many relationship
between them
●
●
sequence Elements are stored in
hierarchical manner
e.g. Tree, Graph
8
Example 1) Tree
●
Trees are used represent data that has
some hierarchical relationship among the
data elements.
9
Tree example 2.
10
Example 2. Graph
●
Graph is used to represent data that
has relationship between pair of
elements.
11
12
7 8.Static & Dynamic data
structure
●
Size of static data structure is fixed throughout
the application.
●
eg. Array
●
Size not fixed. It grows while inserting
elements and reduced when deletinsg
●
elements.
e.g Linked list, Queue, Stack
13