å°Šę•¬ēš„ å¾®äæ”걇ēŽ‡ļ¼š1円 ā‰ˆ 0.046239 元 ę”Æä»˜å®ę±‡ēŽ‡ļ¼š1円 ā‰ˆ 0.04633元 [退å‡ŗē™»å½•]
SlideShare a Scribd company logo
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

More Related Content

Similar to DS.ppt Datatastructures notes presentation

ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
GOOGLEINTERNETCAFE1
Ā 
PM.ppt
PM.pptPM.ppt
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
Madishetty Prathibha
Ā 
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
Ā 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
ColorfullMedia
Ā 
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
sumitbardhan
Ā 
DS Module1 (1).pptx
DS Module1 (1).pptxDS Module1 (1).pptx
DS Module1 (1).pptx
AnuJoseph95
Ā 
stack.pptx
stack.pptxstack.pptx
stack.pptx
mayankKatiyar17
Ā 
1.1 introduction to Data Structures.ppt
1.1 introduction to Data Structures.ppt1.1 introduction to Data Structures.ppt
1.1 introduction to Data Structures.ppt
Ashok280385
Ā 
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 # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
lavparmar007
Ā 
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
Ā 
Stack and queue power point presentation data structure and algorithms Stack-...
Stack and queue power point presentation data structure and algorithms Stack-...Stack and queue power point presentation data structure and algorithms Stack-...
Stack and queue power point presentation data structure and algorithms Stack-...
abhaysingh19149
Ā 
Data structures
Data structuresData structures
Data structures
MADHAVASAIYENDUVA
Ā 
II B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptxII B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptx
sabithabanu83
Ā 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
SaralaT3
Ā 
Data Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptxData Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptx
GIRISHKUMARBC1
Ā 
Lecture 01 Intro to DSA
Lecture 01 Intro to DSALecture 01 Intro to DSA
Lecture 01 Intro to DSA
Nurjahan Nipa
Ā 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
sarala9
Ā 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
MuhammadAmir220
Ā 

Similar to DS.ppt Datatastructures notes presentation (20)

ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
Ā 
PM.ppt
PM.pptPM.ppt
PM.ppt
Ā 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
Ā 
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
Ā 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
Ā 
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
Ā 
DS Module1 (1).pptx
DS Module1 (1).pptxDS Module1 (1).pptx
DS Module1 (1).pptx
Ā 
stack.pptx
stack.pptxstack.pptx
stack.pptx
Ā 
1.1 introduction to Data Structures.ppt
1.1 introduction to Data Structures.ppt1.1 introduction to Data Structures.ppt
1.1 introduction to Data Structures.ppt
Ā 
data structure in programing language.ppt
data structure in programing language.pptdata structure in programing language.ppt
data structure in programing language.ppt
Ā 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
Ā 
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
Ā 
Stack and queue power point presentation data structure and algorithms Stack-...
Stack and queue power point presentation data structure and algorithms Stack-...Stack and queue power point presentation data structure and algorithms Stack-...
Stack and queue power point presentation data structure and algorithms Stack-...
Ā 
Data structures
Data structuresData structures
Data structures
Ā 
II B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptxII B.Sc IT DATA STRUCTURES.pptx
II B.Sc IT DATA STRUCTURES.pptx
Ā 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
Ā 
Data Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptxData Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptx
Ā 
Lecture 01 Intro to DSA
Lecture 01 Intro to DSALecture 01 Intro to DSA
Lecture 01 Intro to DSA
Ā 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
Ā 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
Ā 

Recently uploaded

An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
DharmaBanothu
Ā 
šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...
šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...
šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...
AK47
Ā 
Covid Management System Project Report.pdf
Covid Management System Project Report.pdfCovid Management System Project Report.pdf
Covid Management System Project Report.pdf
Kamal Acharya
Ā 
šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...
šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...
šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...
AK47
Ā 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
Ā 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
Ā 
My Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdfMy Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdf
Geoffrey Wardle. MSc. MSc. Snr.MAIAA
Ā 
Data Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdfData Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdf
Kamal Acharya
Ā 
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Tsuyoshi Horigome
Ā 
Intuit CRAFT demonstration presentation for sde
Intuit CRAFT demonstration presentation for sdeIntuit CRAFT demonstration presentation for sde
Intuit CRAFT demonstration presentation for sde
ShivangMishra54
Ā 
CSP_Study - Notes (Paul McNeill) 2017.pdf
CSP_Study - Notes (Paul McNeill) 2017.pdfCSP_Study - Notes (Paul McNeill) 2017.pdf
CSP_Study - Notes (Paul McNeill) 2017.pdf
Ismail Sultan
Ā 
šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...
šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...
šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...
sonamrawat5631
Ā 
Online train ticket booking system project.pdf
Online train ticket booking system project.pdfOnline train ticket booking system project.pdf
Online train ticket booking system project.pdf
Kamal Acharya
Ā 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
sathishkumars808912
Ā 
Cricket management system ptoject report.pdf
Cricket management system ptoject report.pdfCricket management system ptoject report.pdf
Cricket management system ptoject report.pdf
Kamal Acharya
Ā 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
GOKULKANNANMMECLECTC
Ā 
Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.
supriyaDicholkar1
Ā 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
drshikhapandey2022
Ā 
Technological Innovation Management And Entrepreneurship-1.pdf
Technological Innovation Management And Entrepreneurship-1.pdfTechnological Innovation Management And Entrepreneurship-1.pdf
Technological Innovation Management And Entrepreneurship-1.pdf
tanujaharish2
Ā 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Balvir Singh
Ā 

Recently uploaded (20)

An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
Ā 
šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...
šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...
šŸ”„Independent Call Girls In Pune šŸ’ÆCall Us šŸ” 7014168258 šŸ”šŸ’ƒIndependent Pune Esco...
Ā 
Covid Management System Project Report.pdf
Covid Management System Project Report.pdfCovid Management System Project Report.pdf
Covid Management System Project Report.pdf
Ā 
šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...
šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...
šŸ”„Photo Call Girls Lucknow šŸ’ÆCall Us šŸ” 6350257716 šŸ”šŸ’ƒIndependent Lucknow Escorts...
Ā 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
Ā 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
Ā 
My Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdfMy Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdf
Ā 
Data Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdfData Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdf
Ā 
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Ā 
Intuit CRAFT demonstration presentation for sde
Intuit CRAFT demonstration presentation for sdeIntuit CRAFT demonstration presentation for sde
Intuit CRAFT demonstration presentation for sde
Ā 
CSP_Study - Notes (Paul McNeill) 2017.pdf
CSP_Study - Notes (Paul McNeill) 2017.pdfCSP_Study - Notes (Paul McNeill) 2017.pdf
CSP_Study - Notes (Paul McNeill) 2017.pdf
Ā 
šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...
šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...
šŸ”„Young College Call Girls Chandigarh šŸ’ÆCall Us šŸ” 7737669865 šŸ”šŸ’ƒIndependent Chan...
Ā 
Online train ticket booking system project.pdf
Online train ticket booking system project.pdfOnline train ticket booking system project.pdf
Online train ticket booking system project.pdf
Ā 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
Ā 
Cricket management system ptoject report.pdf
Cricket management system ptoject report.pdfCricket management system ptoject report.pdf
Cricket management system ptoject report.pdf
Ā 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
Ā 
Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.
Ā 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
Ā 
Technological Innovation Management And Entrepreneurship-1.pdf
Technological Innovation Management And Entrepreneurship-1.pdfTechnological Innovation Management And Entrepreneurship-1.pdf
Technological Innovation Management And Entrepreneurship-1.pdf
Ā 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Ā 

DS.ppt Datatastructures notes presentation

  • 1. 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.
  • 2. 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.
  • 3. 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.
  • 4. Classification of Data Structure ā€¢ Data structure are normally divided into two broad categories: ā€¢Primitive Data Structure ā€¢Non-Primitive Data Structure
  • 5. Classification of Data Structure Data structure Primitive DS Non-Primitive DS Integer Float Character Pointer Float Integer Float
  • 6. Classification of Data Structure Non-Primitive DS Linear List Non-Linear List Array Link List Stack Queue Graph Trees
  • 7. 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.
  • 8. 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.
  • 9. 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.
  • 10. 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
  • 11. 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.
  • 12. 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.
  • 13. 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.
  • 14. 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.
  • 15. 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
  • 16. 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.
  • 17. 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]);
  • 18. 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
  • 19. Arrays ā€¢Insertion of new element ā€¢Deletion of required element ā€¢Modification of an element ā€¢Merging of arrays
  • 20. 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.
  • 21. 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]
  • 22. Lists ā€¢ Types of linked lists: ā€¢ Single linked list ā€¢ Doubly linked list ā€¢ Single circular linked list ā€¢ Doubly circular linked list
  • 23. 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).
  • 24. 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.
  • 25. 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]
  • 26. Stack ā€¢ The stack can be implemented into two ways: ā€¢Using arrays (Static implementation) ā€¢Using pointer (Dynamic implementation)
  • 27. 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.
  • 28. 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
  • 29. Queue ā€¢ The queue can be implemented into two ways: ā€¢Using arrays (Static implementation) ā€¢Using pointer (Dynamic implementation)
  • 30. 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.
  • 31. 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.
  • 32. Trees ā€¢ The tree structure organizes the data into branches, which related the information. A B C D E F G root
  • 33. 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.
  • 34. 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.
  • 35. 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
  • 36. Graph ā€¢ Types of Graphs: ā€¢Directed graph ā€¢Undirected graph ā€¢Simple graph ā€¢Weighted graph ā€¢Connected graph ā€¢Non-connected graph
  ēæ»čƑļ¼š