SlideShare a Scribd company logo
DATA STRUCTURES
DEFINITION
 Data structure is representation of the logical relationship
existing between individual elements of data.
 In other words, a data structure is a way of organizing all
data items that considers not only the elements stored but
also their relationship to each other.
INTRODUCTION
 Data structure affects the design of both structural &
functional aspects of a program.
Program=algorithm + Data Structure
 You know that a algorithm is a step by step procedure to solve
a particular function.
INTRODUCTION
 That means, algorithm is a set of instruction written to carry
out certain tasks & the data structure is the way of
organizing the data with their logical relationship retained.
 To develop a program of an algorithm, we should select an
appropriate data structure for that algorithm.
 Therefore algorithm and its associated data structures from a
program.
CLASSIFICATION OF DATA
STRUCTURE
 Data structure are normally divided into two broad
categories:
 Primitive Data Structure
 Non-Primitive Data Structure
CLASSIFICATION OF DATA
STRUCTURE
Data structure
Primitive DS Non-Primitive DS
Integer Float Character Pointer
Float
Integer Float
CLASSIFICATION OF DATA
STRUCTURE
Non-Primitive DS
Linear List Non-Linear List
Array
Link List Stack
Queue Graph Trees
PRIMITIVE DATA
STRUCTURE
 There are basic structures and directly operated upon by
the machine instructions.
 In general, there are different representation on different
computers.
 Integer, Floating-point number, Character constants,
string constants, pointers etc, fall in this category.
NON-PRIMITIVE DATA
STRUCTURE
 There are more sophisticated data structures.
 These are derived from the primitive data structures.
 The non-primitive data structures emphasize on
structuring of a group of homogeneous (same type) or
heterogeneous (different type) data items.
NON-PRIMITIVE DATA
STRUCTURE
 Lists, Stack, Queue, Tree, Graph are example of non-
primitive data structures.
 The design of an efficient data structure must take
operations to be performed on the data structure.
NON-PRIMITIVE DATA
STRUCTURE
 The most commonly used operation on data structure are
broadly categorized into following types:
 Create
 Selection
 Updating
 Searching
 Sorting
 Merging
 Destroy or Delete
DIFFERENT BETWEEN THEM
 A primitive data structure is generally a basic structure
that is usually built into the language, such as an integer,
a float.
 A non-primitive data structure is built out of primitive
data structures linked together in meaningful ways, such
as a or a linked-list, binary search tree, AVL Tree, graph
etc.
DESCRIPTION OF VARIOUS
DATA STRUCTURES : ARRAYS
 An array is defined as a set of finite number of
homogeneous elements or same data items.
 It means an array can contain one type of data only,
either all integer, all float-point number or all character.
ARRAYS
 Simply, declaration of array is as follows:
int arr[10]
 Where int specifies the data type or type of elements arrays
stores.
 “arr” is the name of array & the number specified inside the
square brackets is the number of elements an array can store,
this is also called sized or length of array.
ARRAYS
 Following are some of the concepts to be remembered
about arrays:
 The individual element of an array can
be accessed by specifying name of the
array, following by index or subscript
inside square brackets.
 The first element of the array has index
zero[0]. It means the first element and
last element will be specified as:arr[0]
& arr[9]
Respectively.
ARRAYS
 The elements of array will always be stored
in the consecutive (continues) memory
location.
 The number of elements that can be stored
in an array, that is the size of array or its
length is given by the following equation:
(Upperbound-lowerbound)+1
ARRAYS
 For the above array it would be
(9-0)+1=10,where 0 is the lower bound
of array and 9 is the upper bound of
array.
 Array can always be read or written
through loop. If we read a one-
dimensional array it require one loop for
reading and other for writing the array.
ARRAYS
 For example: Reading an array
For(i=0;i<=9;i++)
scanf(“%d”,&arr[i]);
 For example: Writing an array
For(i=0;i<=9;i++)
printf(“%d”,arr[i]);
ARRAYS
 If we are reading or writing two-
dimensional array it would require two
loops. And similarly the array of a N
dimension would required N loops.
 Some common operation performed on
array are:
Creation of an array
Traversing an array
ARRAYS
 Insertion of new element
 Deletion of required element
 Modification of an element
 Merging of arrays
LISTS
 A lists (Linear linked list) can be defined as a collection of
variable number of data items.
 Lists are the most commonly used non-primitive data
structures.
 An element of list must contain at least two fields, one for
storing data or information and other for storing address of
next element.
 As you know for storing address we have a special data
structure of list the address must be pointer type.
LISTS
 Technically each such element is referred to as a node,
therefore a list can be defined as a collection of nodes as
show bellow:
Head
AAA BBB CCC
Information field Pointer field
[Linear Liked List]
LISTS
 Types of linked lists:
 Single linked list
 Doubly linked list
 Single circular linked list
 Doubly circular linked list
STACK
 A stack is also an ordered collection of elements like
arrays, but it has a special feature that deletion and
insertion of elements can be done only from one end
called the top of the stack (TOP)
 Due to this property it is also called as last in first out
type of data structure (LIFO).
STACK
 It could be through of just like a stack of plates placed on table in
a party, a guest always takes off a fresh plate from the top and the
new plates are placed on to the stack at the top.
 It is a non-primitive data structure.
 When an element is inserted into a stack or removed from the
stack, its base remains fixed where the top of stack changes.
STACK
 Insertion of element into stack is called PUSH and
deletion of element from stack is called POP.
 The bellow show figure how the operations take place on
a stack:
PUSH POP
[STACK]
STACK
 The stack can be implemented into two ways:
 Using arrays (Static implementation)
 Using pointer (Dynamic
implementation)
QUEUE
 Queue are first in first out type of data structure (i.e. FIFO)
 In a queue new elements are added to the queue from one
end called REAR end and the element are always removed
from other end called the FRONT end.
 The people standing in a railway reservation row are an
example of queue.
QUEUE
 Each new person comes and stands at the end of the row
and person getting their reservation confirmed get out of
the row from the front end.
 The bellow show figure how the operations take place on
a stack:
10 20 30 40 50
front rear
QUEUE
 The queue can be implemented into two ways:
 Using arrays (Static implementation)
 Using pointer (Dynamic
implementation)
TREES
 A tree can be defined as finite set of data items (nodes).
 Tree is non-linear type of data structure in which data
items are arranged or stored in a sorted sequence.
 Tree represent the hierarchical relationship between
various elements.
TREES
 In trees:
 There is a special data item at the top of hierarchy called the
Root of the tree.
 The remaining data items are partitioned into number of
mutually exclusive subset, each of which is itself, a tree
which is called the sub tree.
 The tree always grows in length towards bottom in data
structures, unlike natural trees which grows upwards.
TREES
 The tree structure organizes the data into branches,
which related the information.
A
B C
D E F G
root
GRAPH
 Graph is a mathematical non-linear data structure
capable of representing many kind of physical structures.
 It has found application in Geography, Chemistry and
Engineering sciences.
 Definition: A graph G(V,E) is a set of vertices V and a
set of edges E.
GRAPH
 An edge connects a pair of vertices and many have
weight such as length, cost and another measuring
instrument for according the graph.
 Vertices on the graph are shown as point or circles and
edges are drawn as arcs or line segment.
GRAPH
 Example of graph:
v2
v1
v4
v5
v3
10
15
8
6
11
9
v4
v1
v2
v4
v3
[a] Directed &
Weighted Graph
[b] Undirected Graph
GRAPH
 Types of Graphs:
 Directed graph
 Undirected graph
 Simple graph
 Weighted graph
 Connected graph
 Non-connected graph
Ad

More Related Content

Similar to PM.ppt DATA STRUCTURE USING C WITH EXAMPLE PROGRAMES (20)

02-dataStructurePM and algortima for python.ppt
02-dataStructurePM and algortima for python.ppt02-dataStructurePM and algortima for python.ppt
02-dataStructurePM and algortima for python.ppt
totowahid1
 
DATA STRUCTURES IN INFORMATION TECHNOLOGY
DATA STRUCTURES IN INFORMATION TECHNOLOGYDATA STRUCTURES IN INFORMATION TECHNOLOGY
DATA STRUCTURES IN INFORMATION TECHNOLOGY
DanilynSukkie
 
different types of data structures using c.ppt
different types of data structures using c.pptdifferent types of data structures using c.ppt
different types of data structures using c.ppt
RaviKumarChavali1
 
data structure details of types and .ppt
data structure details of types and .pptdata structure details of types and .ppt
data structure details of types and .ppt
poonamsngr
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
PraveenKumar977108
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
yarotos643
 
data structure in programing language.ppt
data structure in programing language.pptdata structure in programing language.ppt
data structure in programing language.ppt
LavkushGupta12
 
data structure programing language in c.ppt
data structure programing language in c.pptdata structure programing language in c.ppt
data structure programing language in c.ppt
LavkushGupta12
 
data structures module I & II.pptx
data structures module I & II.pptxdata structures module I & II.pptx
data structures module I & II.pptx
rani marri
 
data structure algorithm example and example
data structure algorithm example and exampledata structure algorithm example and example
data structure algorithm example and example
lionelmessi593584
 
intr_ds.ppt
intr_ds.pptintr_ds.ppt
intr_ds.ppt
PrakharNamdev3
 
DS_PPT.pptx
DS_PPT.pptxDS_PPT.pptx
DS_PPT.pptx
MeghaKulkarni27
 
DS_PPT.ppt
DS_PPT.pptDS_PPT.ppt
DS_PPT.ppt
MeghaKulkarni27
 
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptxDS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
ProfVMGawde
 
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptxDS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
ProfVMGawde
 
DS2-CLASSIFICATION11111111111111111111111111111111.pptx
DS2-CLASSIFICATION11111111111111111111111111111111.pptxDS2-CLASSIFICATION11111111111111111111111111111111.pptx
DS2-CLASSIFICATION11111111111111111111111111111111.pptx
ProfVMGawde
 
Intro ds
Intro dsIntro ds
Intro ds
John Fathima
 
DS.ppt Datatastructures notes presentation
DS.ppt Datatastructures notes presentationDS.ppt Datatastructures notes presentation
DS.ppt Datatastructures notes presentation
SakkaravarthiShanmug
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - Introduction
DeepaThirumurugan
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
meenamadhuvandhi2
 
02-dataStructurePM and algortima for python.ppt
02-dataStructurePM and algortima for python.ppt02-dataStructurePM and algortima for python.ppt
02-dataStructurePM and algortima for python.ppt
totowahid1
 
DATA STRUCTURES IN INFORMATION TECHNOLOGY
DATA STRUCTURES IN INFORMATION TECHNOLOGYDATA STRUCTURES IN INFORMATION TECHNOLOGY
DATA STRUCTURES IN INFORMATION TECHNOLOGY
DanilynSukkie
 
different types of data structures using c.ppt
different types of data structures using c.pptdifferent types of data structures using c.ppt
different types of data structures using c.ppt
RaviKumarChavali1
 
data structure details of types and .ppt
data structure details of types and .pptdata structure details of types and .ppt
data structure details of types and .ppt
poonamsngr
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
yarotos643
 
data structure in programing language.ppt
data structure in programing language.pptdata structure in programing language.ppt
data structure in programing language.ppt
LavkushGupta12
 
data structure programing language in c.ppt
data structure programing language in c.pptdata structure programing language in c.ppt
data structure programing language in c.ppt
LavkushGupta12
 
data structures module I & II.pptx
data structures module I & II.pptxdata structures module I & II.pptx
data structures module I & II.pptx
rani marri
 
data structure algorithm example and example
data structure algorithm example and exampledata structure algorithm example and example
data structure algorithm example and example
lionelmessi593584
 
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptxDS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
ProfVMGawde
 
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptxDS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
DS2-CLASSIFICATIONnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.pptx
ProfVMGawde
 
DS2-CLASSIFICATION11111111111111111111111111111111.pptx
DS2-CLASSIFICATION11111111111111111111111111111111.pptxDS2-CLASSIFICATION11111111111111111111111111111111.pptx
DS2-CLASSIFICATION11111111111111111111111111111111.pptx
ProfVMGawde
 
DS.ppt Datatastructures notes presentation
DS.ppt Datatastructures notes presentationDS.ppt Datatastructures notes presentation
DS.ppt Datatastructures notes presentation
SakkaravarthiShanmug
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - Introduction
DeepaThirumurugan
 

More from NagarathnaRajur2 (20)

C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptC-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
NagarathnaRajur2
 
Basics of C.ppt VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Basics of C.ppt  VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBasics of C.ppt  VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Basics of C.ppt VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
NagarathnaRajur2
 
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptC-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
NagarathnaRajur2
 
lecture-ON-C.ppt BASIC WITH DEPTH CONTENT
lecture-ON-C.ppt  BASIC WITH DEPTH CONTENTlecture-ON-C.ppt  BASIC WITH DEPTH CONTENT
lecture-ON-C.ppt BASIC WITH DEPTH CONTENT
NagarathnaRajur2
 
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICALOPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
NagarathnaRajur2
 
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
EXCEPTIONS-PYTHON.pptx   RUNTIME ERRORS HANDLINGEXCEPTIONS-PYTHON.pptx   RUNTIME ERRORS HANDLING
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
NagarathnaRajur2
 
OOPS-PYTHON.pptx OOPS IN PYTHON APPLIED PROGRAMMING
OOPS-PYTHON.pptx    OOPS IN PYTHON APPLIED PROGRAMMINGOOPS-PYTHON.pptx    OOPS IN PYTHON APPLIED PROGRAMMING
OOPS-PYTHON.pptx OOPS IN PYTHON APPLIED PROGRAMMING
NagarathnaRajur2
 
ppt on arm memory.pptx yjjghjghjjjjjjjj
ppt on arm memory.pptx   yjjghjghjjjjjjjjppt on arm memory.pptx   yjjghjghjjjjjjjj
ppt on arm memory.pptx yjjghjghjjjjjjjj
NagarathnaRajur2
 
05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE
05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE
05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE
NagarathnaRajur2
 
8051 programes -ppt.pptx bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn
8051 programes -ppt.pptx  bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn8051 programes -ppt.pptx  bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn
8051 programes -ppt.pptx bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn
NagarathnaRajur2
 
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
Chapter_04_ARM_Assembly.pptx   ARM ASSEMBLY CODEChapter_04_ARM_Assembly.pptx   ARM ASSEMBLY CODE
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
NagarathnaRajur2
 
MEMORY.ppt 8051/8052 MEMORY MANEGEMENT MEMORY DESCRIPTION
MEMORY.ppt 8051/8052  MEMORY MANEGEMENT MEMORY DESCRIPTIONMEMORY.ppt 8051/8052  MEMORY MANEGEMENT MEMORY DESCRIPTION
MEMORY.ppt 8051/8052 MEMORY MANEGEMENT MEMORY DESCRIPTION
NagarathnaRajur2
 
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTERCHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
NagarathnaRajur2
 
Core-Java-by-Mahika-Tutor.9459891.powerpoint.pptx
Core-Java-by-Mahika-Tutor.9459891.powerpoint.pptxCore-Java-by-Mahika-Tutor.9459891.powerpoint.pptx
Core-Java-by-Mahika-Tutor.9459891.powerpoint.pptx
NagarathnaRajur2
 
review.pptx mnbmnbm,nb,n,nm,mn,mn,n,nm,
review.pptx  mnbmnbm,nb,n,nm,mn,mn,n,nm,review.pptx  mnbmnbm,nb,n,nm,mn,mn,n,nm,
review.pptx mnbmnbm,nb,n,nm,mn,mn,n,nm,
NagarathnaRajur2
 
IOT introduction with applications ffffffffffffffffffffff
IOT introduction with applications ffffffffffffffffffffffIOT introduction with applications ffffffffffffffffffffff
IOT introduction with applications ffffffffffffffffffffff
NagarathnaRajur2
 
CORE JAVA PPT FOR ENGINEERS BBBBBBBBBBBBBBBBBBB
CORE JAVA PPT FOR ENGINEERS  BBBBBBBBBBBBBBBBBBBCORE JAVA PPT FOR ENGINEERS  BBBBBBBBBBBBBBBBBBB
CORE JAVA PPT FOR ENGINEERS BBBBBBBBBBBBBBBBBBB
NagarathnaRajur2
 
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBBJAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
NagarathnaRajur2
 
JavaSteps. PPT NBNBVNBNVBNNNNNNNNNNNNNN
JavaSteps. PPT  NBNBVNBNVBNNNNNNNNNNNNNNJavaSteps. PPT  NBNBVNBNVBNNNNNNNNNNNNNN
JavaSteps. PPT NBNBVNBNVBNNNNNNNNNNNNNN
NagarathnaRajur2
 
JAVA METHODS PRESENTATION WITH EXAMPLES DFDFFD FDGFDGDFG FGGF
JAVA METHODS PRESENTATION WITH EXAMPLES  DFDFFD   FDGFDGDFG   FGGFJAVA METHODS PRESENTATION WITH EXAMPLES  DFDFFD   FDGFDGDFG   FGGF
JAVA METHODS PRESENTATION WITH EXAMPLES DFDFFD FDGFDGDFG FGGF
NagarathnaRajur2
 
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptC-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
NagarathnaRajur2
 
Basics of C.ppt VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Basics of C.ppt  VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBasics of C.ppt  VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Basics of C.ppt VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
NagarathnaRajur2
 
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.pptC-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
NagarathnaRajur2
 
lecture-ON-C.ppt BASIC WITH DEPTH CONTENT
lecture-ON-C.ppt  BASIC WITH DEPTH CONTENTlecture-ON-C.ppt  BASIC WITH DEPTH CONTENT
lecture-ON-C.ppt BASIC WITH DEPTH CONTENT
NagarathnaRajur2
 
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICALOPERATORS-PYTHON.pptx   ALL OPERATORS ARITHMATIC AND LOGICAL
OPERATORS-PYTHON.pptx ALL OPERATORS ARITHMATIC AND LOGICAL
NagarathnaRajur2
 
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
EXCEPTIONS-PYTHON.pptx   RUNTIME ERRORS HANDLINGEXCEPTIONS-PYTHON.pptx   RUNTIME ERRORS HANDLING
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
NagarathnaRajur2
 
OOPS-PYTHON.pptx OOPS IN PYTHON APPLIED PROGRAMMING
OOPS-PYTHON.pptx    OOPS IN PYTHON APPLIED PROGRAMMINGOOPS-PYTHON.pptx    OOPS IN PYTHON APPLIED PROGRAMMING
OOPS-PYTHON.pptx OOPS IN PYTHON APPLIED PROGRAMMING
NagarathnaRajur2
 
ppt on arm memory.pptx yjjghjghjjjjjjjj
ppt on arm memory.pptx   yjjghjghjjjjjjjjppt on arm memory.pptx   yjjghjghjjjjjjjj
ppt on arm memory.pptx yjjghjghjjjjjjjj
NagarathnaRajur2
 
05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE
05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE
05_Thumb (15).pptx ARM MICROCONTROLLERS THUMB INSTRUCTIONS WORKING PRINCIPLE
NagarathnaRajur2
 
8051 programes -ppt.pptx bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn
8051 programes -ppt.pptx  bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn8051 programes -ppt.pptx  bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn
8051 programes -ppt.pptx bnvmmmmmmmmmmmmmmmmmmmmmmmmmmhn
NagarathnaRajur2
 
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
Chapter_04_ARM_Assembly.pptx   ARM ASSEMBLY CODEChapter_04_ARM_Assembly.pptx   ARM ASSEMBLY CODE
Chapter_04_ARM_Assembly.pptx ARM ASSEMBLY CODE
NagarathnaRajur2
 
MEMORY.ppt 8051/8052 MEMORY MANEGEMENT MEMORY DESCRIPTION
MEMORY.ppt 8051/8052  MEMORY MANEGEMENT MEMORY DESCRIPTIONMEMORY.ppt 8051/8052  MEMORY MANEGEMENT MEMORY DESCRIPTION
MEMORY.ppt 8051/8052 MEMORY MANEGEMENT MEMORY DESCRIPTION
NagarathnaRajur2
 
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTERCHAPTER1.pptx  ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
CHAPTER1.pptx ON 8051 MICROCONTROLLER INTRODUCTION CHAPTER
NagarathnaRajur2
 
Core-Java-by-Mahika-Tutor.9459891.powerpoint.pptx
Core-Java-by-Mahika-Tutor.9459891.powerpoint.pptxCore-Java-by-Mahika-Tutor.9459891.powerpoint.pptx
Core-Java-by-Mahika-Tutor.9459891.powerpoint.pptx
NagarathnaRajur2
 
review.pptx mnbmnbm,nb,n,nm,mn,mn,n,nm,
review.pptx  mnbmnbm,nb,n,nm,mn,mn,n,nm,review.pptx  mnbmnbm,nb,n,nm,mn,mn,n,nm,
review.pptx mnbmnbm,nb,n,nm,mn,mn,n,nm,
NagarathnaRajur2
 
IOT introduction with applications ffffffffffffffffffffff
IOT introduction with applications ffffffffffffffffffffffIOT introduction with applications ffffffffffffffffffffff
IOT introduction with applications ffffffffffffffffffffff
NagarathnaRajur2
 
CORE JAVA PPT FOR ENGINEERS BBBBBBBBBBBBBBBBBBB
CORE JAVA PPT FOR ENGINEERS  BBBBBBBBBBBBBBBBBBBCORE JAVA PPT FOR ENGINEERS  BBBBBBBBBBBBBBBBBBB
CORE JAVA PPT FOR ENGINEERS BBBBBBBBBBBBBBBBBBB
NagarathnaRajur2
 
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBBJAVA CLASS PPT FOR ENGINEERING STUDENTS  BBBBBBBBBBBBBBBBBBB
JAVA CLASS PPT FOR ENGINEERING STUDENTS BBBBBBBBBBBBBBBBBBB
NagarathnaRajur2
 
JavaSteps. PPT NBNBVNBNVBNNNNNNNNNNNNNN
JavaSteps. PPT  NBNBVNBNVBNNNNNNNNNNNNNNJavaSteps. PPT  NBNBVNBNVBNNNNNNNNNNNNNN
JavaSteps. PPT NBNBVNBNVBNNNNNNNNNNNNNN
NagarathnaRajur2
 
JAVA METHODS PRESENTATION WITH EXAMPLES DFDFFD FDGFDGDFG FGGF
JAVA METHODS PRESENTATION WITH EXAMPLES  DFDFFD   FDGFDGDFG   FGGFJAVA METHODS PRESENTATION WITH EXAMPLES  DFDFFD   FDGFDGDFG   FGGF
JAVA METHODS PRESENTATION WITH EXAMPLES DFDFFD FDGFDGDFG FGGF
NagarathnaRajur2
 
Ad

Recently uploaded (20)

Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
Ad

PM.ppt DATA STRUCTURE USING C WITH EXAMPLE PROGRAMES

  • 2. DEFINITION  Data structure is representation of the logical relationship existing between individual elements of data.  In other words, a data structure is a way of organizing all data items that considers not only the elements stored but also their relationship to each other.
  • 3. INTRODUCTION  Data structure affects the design of both structural & functional aspects of a program. Program=algorithm + Data Structure  You know that a algorithm is a step by step procedure to solve a particular function.
  • 4. INTRODUCTION  That means, algorithm is a set of instruction written to carry out certain tasks & the data structure is the way of organizing the data with their logical relationship retained.  To develop a program of an algorithm, we should select an appropriate data structure for that algorithm.  Therefore algorithm and its associated data structures from a program.
  • 5. CLASSIFICATION OF DATA STRUCTURE  Data structure are normally divided into two broad categories:  Primitive Data Structure  Non-Primitive Data Structure
  • 6. CLASSIFICATION OF DATA STRUCTURE Data structure Primitive DS Non-Primitive DS Integer Float Character Pointer Float Integer Float
  • 7. CLASSIFICATION OF DATA STRUCTURE Non-Primitive DS Linear List Non-Linear List Array Link List Stack Queue Graph Trees
  • 8. PRIMITIVE DATA STRUCTURE  There are basic structures and directly operated upon by the machine instructions.  In general, there are different representation on different computers.  Integer, Floating-point number, Character constants, string constants, pointers etc, fall in this category.
  • 9. NON-PRIMITIVE DATA STRUCTURE  There are more sophisticated data structures.  These are derived from the primitive data structures.  The non-primitive data structures emphasize on structuring of a group of homogeneous (same type) or heterogeneous (different type) data items.
  • 10. NON-PRIMITIVE DATA STRUCTURE  Lists, Stack, Queue, Tree, Graph are example of non- primitive data structures.  The design of an efficient data structure must take operations to be performed on the data structure.
  • 11. NON-PRIMITIVE DATA STRUCTURE  The most commonly used operation on data structure are broadly categorized into following types:  Create  Selection  Updating  Searching  Sorting  Merging  Destroy or Delete
  • 12. DIFFERENT BETWEEN THEM  A primitive data structure is generally a basic structure that is usually built into the language, such as an integer, a float.  A non-primitive data structure is built out of primitive data structures linked together in meaningful ways, such as a or a linked-list, binary search tree, AVL Tree, graph etc.
  • 13. DESCRIPTION OF VARIOUS DATA STRUCTURES : ARRAYS  An array is defined as a set of finite number of homogeneous elements or same data items.  It means an array can contain one type of data only, either all integer, all float-point number or all character.
  • 14. ARRAYS  Simply, declaration of array is as follows: int arr[10]  Where int specifies the data type or type of elements arrays stores.  “arr” is the name of array & the number specified inside the square brackets is the number of elements an array can store, this is also called sized or length of array.
  • 15. ARRAYS  Following are some of the concepts to be remembered about arrays:  The individual element of an array can be accessed by specifying name of the array, following by index or subscript inside square brackets.  The first element of the array has index zero[0]. It means the first element and last element will be specified as:arr[0] & arr[9] Respectively.
  • 16. ARRAYS  The elements of array will always be stored in the consecutive (continues) memory location.  The number of elements that can be stored in an array, that is the size of array or its length is given by the following equation: (Upperbound-lowerbound)+1
  • 17. ARRAYS  For the above array it would be (9-0)+1=10,where 0 is the lower bound of array and 9 is the upper bound of array.  Array can always be read or written through loop. If we read a one- dimensional array it require one loop for reading and other for writing the array.
  • 18. ARRAYS  For example: Reading an array For(i=0;i<=9;i++) scanf(“%d”,&arr[i]);  For example: Writing an array For(i=0;i<=9;i++) printf(“%d”,arr[i]);
  • 19. ARRAYS  If we are reading or writing two- dimensional array it would require two loops. And similarly the array of a N dimension would required N loops.  Some common operation performed on array are: Creation of an array Traversing an array
  • 20. ARRAYS  Insertion of new element  Deletion of required element  Modification of an element  Merging of arrays
  • 21. LISTS  A lists (Linear linked list) can be defined as a collection of variable number of data items.  Lists are the most commonly used non-primitive data structures.  An element of list must contain at least two fields, one for storing data or information and other for storing address of next element.  As you know for storing address we have a special data structure of list the address must be pointer type.
  • 22. LISTS  Technically each such element is referred to as a node, therefore a list can be defined as a collection of nodes as show bellow: Head AAA BBB CCC Information field Pointer field [Linear Liked List]
  • 23. LISTS  Types of linked lists:  Single linked list  Doubly linked list  Single circular linked list  Doubly circular linked list
  • 24. STACK  A stack is also an ordered collection of elements like arrays, but it has a special feature that deletion and insertion of elements can be done only from one end called the top of the stack (TOP)  Due to this property it is also called as last in first out type of data structure (LIFO).
  • 25. STACK  It could be through of just like a stack of plates placed on table in a party, a guest always takes off a fresh plate from the top and the new plates are placed on to the stack at the top.  It is a non-primitive data structure.  When an element is inserted into a stack or removed from the stack, its base remains fixed where the top of stack changes.
  • 26. STACK  Insertion of element into stack is called PUSH and deletion of element from stack is called POP.  The bellow show figure how the operations take place on a stack: PUSH POP [STACK]
  • 27. STACK  The stack can be implemented into two ways:  Using arrays (Static implementation)  Using pointer (Dynamic implementation)
  • 28. QUEUE  Queue are first in first out type of data structure (i.e. FIFO)  In a queue new elements are added to the queue from one end called REAR end and the element are always removed from other end called the FRONT end.  The people standing in a railway reservation row are an example of queue.
  • 29. QUEUE  Each new person comes and stands at the end of the row and person getting their reservation confirmed get out of the row from the front end.  The bellow show figure how the operations take place on a stack: 10 20 30 40 50 front rear
  • 30. QUEUE  The queue can be implemented into two ways:  Using arrays (Static implementation)  Using pointer (Dynamic implementation)
  • 31. TREES  A tree can be defined as finite set of data items (nodes).  Tree is non-linear type of data structure in which data items are arranged or stored in a sorted sequence.  Tree represent the hierarchical relationship between various elements.
  • 32. TREES  In trees:  There is a special data item at the top of hierarchy called the Root of the tree.  The remaining data items are partitioned into number of mutually exclusive subset, each of which is itself, a tree which is called the sub tree.  The tree always grows in length towards bottom in data structures, unlike natural trees which grows upwards.
  • 33. TREES  The tree structure organizes the data into branches, which related the information. A B C D E F G root
  • 34. GRAPH  Graph is a mathematical non-linear data structure capable of representing many kind of physical structures.  It has found application in Geography, Chemistry and Engineering sciences.  Definition: A graph G(V,E) is a set of vertices V and a set of edges E.
  • 35. GRAPH  An edge connects a pair of vertices and many have weight such as length, cost and another measuring instrument for according the graph.  Vertices on the graph are shown as point or circles and edges are drawn as arcs or line segment.
  • 36. GRAPH  Example of graph: v2 v1 v4 v5 v3 10 15 8 6 11 9 v4 v1 v2 v4 v3 [a] Directed & Weighted Graph [b] Undirected Graph
  • 37. GRAPH  Types of Graphs:  Directed graph  Undirected graph  Simple graph  Weighted graph  Connected graph  Non-connected graph
  翻译: