SlideShare a Scribd company logo
1 of 25
Introduction to
Data Structure
What is Data Structure?
 A data structure is a particular way of
storing and organizing data in a computer
so that it can be used efficiently.
 They provide a means to manage large
amounts of data efficiently, such as large
databases.
 Data are simply values or set of values
and Database is organized collection of
data.
Department of CSE 2
What is Data Structure? (…contd)
A data structure is a logical and
mathematical model of a particular
organization of data.
The choice of particular data structure
depends upon following consideration:
1.It must be able to represent the inherent
relationship of data in the real world.
2.It must be simple enough so that it can be
processed efficiently as and when
necessary.
Department of CSE 3
THE STUDY OF DATA
STRUCTURE INCLUDE:
 Logical description of data structure
 Implementation of data structure
 Quantitative analysis of data structure, this include
amount of memory, processing time
Department of CSE 4
Classification of Data Structure
Data Structures
Department of CSE 5
Primitive Data Structures Non-Primitive Data Structures
Integer Real Character Boolean Linear Data
Structures
Non -Linear
Data Structures
Arrays
Stack
sLinked
List
Queues
Trees
Graphs
Classification (contd..)
A data structure can be broadly classified into
 Primitive data structure
 Non-primitive data structure
Primitive data structure :-The data structures, that are
directly operated upon by machine level instructions i.e.
the fundamental data types such as int, float in case of
‘c’ are known as primitive data structures.
Non- Primitive data structure :-These are more complex
data structures. These data structures are derived from
the primitive data structures.
Department of CSE 6
Classification (contd..)
Non-Primitive Data Structures can be further divided into
two categories:
 Linear Data Structures
 Non-Linear Data Structures.
Linear Data Structures:-In linear data structures, data
elements are organized sequentially and therefore they
are easy to implement in the computer’s memory. E.g.
Arrays.
 Non-Linear Data Structures:-In nonlinear data
structures, a data element can be attached to several
other data elements to represent specific relationships
that exist among them. E.g. Graphs
Department of CSE 7
Array & Linked List
Department of CSE 8
[0] [1] [2]
A B CArray
linked
A B CLinked list
Linked lists are unbounded
(maximum number of items limited only by memory)
node
Stack
 Stack
◦ New nodes can be added and removed only at the top
◦ Similar to a pile of dishes
◦ Last-in, first-out (LIFO)
 push
◦ Adds a new node to the top of the stack
 pop
◦ Removes a node from the top
Department of CSE 9
Stack
 A stack is a list in which insertion and
deletion take place at the same end
◦ This end is called top
◦ The other end is called bottom.
Department of CSE 10
Queue
 Queue
◦ Similar to a supermarket checkout line
◦ First-in, first-out (FIFO)
◦ Nodes are removed only from the head
◦ Nodes are inserted only at the tail
 Insert and remove operations
◦ Enqueue (insert) and dequeue (remove)
Department of CSE 11
The Queue Operations
 A queue is like a
line of people
waiting for a bank
teller. The queue
has a front and a
rear.
Department of CSE 12
$ $
Front(Removal)Rear(insertion)
Walking out
Tree
A tree T is a finite non empty set of
elements. One of these elements is called
the root, and the remaining elements, if
any, are portioned into trees, which are
called the sub trees of T.
Department of CSE 13
Tree (example)
Department of CSE 14
node
Graph
 A graph is defined as:
“Graph G is a ordered set (V,E), where V(G)
represent the set of elements, called vertices, and
E(G) represents the edges between these
vertices.”
 Graphs can be
◦ Undirected
◦ Directed
Department of CSE 15
Graph
Figure shows a sample graph
V(G)={v1,v2,v3,v4,v5}
E(G)={e1,e2,e3,e4,e5}
Department of CSE 16
v1
v5
v4
v2 v3
e2
e1
e5
e4
e3
Fig . (a) Undirected Graph
Graph
Department of CSE 17
v1
v5
v4
v2 v3
e2
e1
e5
e4
e3
Fig. (b) Directed Graph
In directed graph, an edge is represented by an ordered pair (u,v) (i.e.=(u,v)),
that can be traversed only from u toward v.
Data Structure Operations
Five major operations are associated with all data
structures.
i. Creation:- Initialization of the beginning.
ii. Insertion: - Insertion means adding new details
or new node into the data structure.
iii. Deletion: - Deletion means removing a node
from the data structure.
iv. Traversal: - Traversing means accessing each
node exactly once so that the nodes of a data
structure can be processed. Traversing is also
called as visiting.
v. Searching: - Searching means finding the
location of node for a given key value.
Department of CSE 18
Data Structure Operations(contd..)
 Apart from the four operations mentioned
above, there are two more operations
occasionally performed on data structures. They
are:
(a) Sorting: -Sorting means arranging the data in
a particular order.
(b) Merging: - Merging means joining two lists.
Department of CSE 19
A first look on ADTs
 Solving a problem involves processing
data, and an important part of the solution
is the efficient organization of the data
 In order to do that, we need to identify:
1. The collection of data items
2. Basic operation that must be performed
on them
Abstract Data Type (ADT)
 The word “abstract” refers to the fact
that the data and the basic operations
defined on it are being studied
independently of how they are
implemented
 We think about what can be done with
the data, not how it is done
Primitive Data Type vs ADT
Department of CSE 22
Some ADT’s
Some user defined ADT’s are
 Stacks
 Queues
Department of CSE 23
Stack ADT
We define a stack as an ADT as shown
below:
Department of CSE 24
Queue ADT
We define a queue as an ADT as shown
below:
Department of CSE 25

More Related Content

What's hot

data structure
data structuredata structure
data structurehashim102
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm KristinaBorooah
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSGokul Hari
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST Kathirvel Ayyaswamy
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation Anil Kumar Prajapati
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)Elavarasi K
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data StructureDharita Chokshi
 
Linked stacks and queues
Linked stacks and queuesLinked stacks and queues
Linked stacks and queuesRamzi Alqrainy
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structureAbrish06
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array pptsandhya yadav
 
Quick sort-Data Structure
Quick sort-Data StructureQuick sort-Data Structure
Quick sort-Data StructureJeanie Arnoco
 
Presentation on array
Presentation on array Presentation on array
Presentation on array topu93
 

What's hot (20)

data structure
data structuredata structure
data structure
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm
 
single linked list
single linked listsingle linked list
single linked list
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST
 
Linked List
Linked ListLinked List
Linked List
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
 
Binary Search
Binary SearchBinary Search
Binary Search
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
Linked stacks and queues
Linked stacks and queuesLinked stacks and queues
Linked stacks and queues
 
stack presentation
stack presentationstack presentation
stack presentation
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
Quick sort-Data Structure
Quick sort-Data StructureQuick sort-Data Structure
Quick sort-Data Structure
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 

Similar to Introduction to data structure ppt

DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxSaralaT3
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxsarala9
 
data structures module I & II.pptx
data structures module I & II.pptxdata structures module I & II.pptx
data structures module I & II.pptxrani marri
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfMaryJacob24
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxmexiuro901
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresresamplopsurat
 
Chapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.pptChapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.pptNORSHADILAAHMADBADEL
 
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 .pptpoonamsngr
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfAxmedcarb
 

Similar to Introduction to data structure ppt (20)

DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
data structures module I & II.pptx
data structures module I & II.pptxdata structures module I & II.pptx
data structures module I & II.pptx
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Ch1
Ch1Ch1
Ch1
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
 
Chapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.pptChapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.ppt
 
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
 
104333 sri vidhya eng notes
104333 sri vidhya eng notes104333 sri vidhya eng notes
104333 sri vidhya eng notes
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
PM.ppt
PM.pptPM.ppt
PM.ppt
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
 
PM.ppt
PM.pptPM.ppt
PM.ppt
 

Recently uploaded

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Recently uploaded (20)

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 

Introduction to data structure ppt

  • 2. What is Data Structure?  A data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.  They provide a means to manage large amounts of data efficiently, such as large databases.  Data are simply values or set of values and Database is organized collection of data. Department of CSE 2
  • 3. What is Data Structure? (…contd) A data structure is a logical and mathematical model of a particular organization of data. The choice of particular data structure depends upon following consideration: 1.It must be able to represent the inherent relationship of data in the real world. 2.It must be simple enough so that it can be processed efficiently as and when necessary. Department of CSE 3
  • 4. THE STUDY OF DATA STRUCTURE INCLUDE:  Logical description of data structure  Implementation of data structure  Quantitative analysis of data structure, this include amount of memory, processing time Department of CSE 4
  • 5. Classification of Data Structure Data Structures Department of CSE 5 Primitive Data Structures Non-Primitive Data Structures Integer Real Character Boolean Linear Data Structures Non -Linear Data Structures Arrays Stack sLinked List Queues Trees Graphs
  • 6. Classification (contd..) A data structure can be broadly classified into  Primitive data structure  Non-primitive data structure Primitive data structure :-The data structures, that are directly operated upon by machine level instructions i.e. the fundamental data types such as int, float in case of ‘c’ are known as primitive data structures. Non- Primitive data structure :-These are more complex data structures. These data structures are derived from the primitive data structures. Department of CSE 6
  • 7. Classification (contd..) Non-Primitive Data Structures can be further divided into two categories:  Linear Data Structures  Non-Linear Data Structures. Linear Data Structures:-In linear data structures, data elements are organized sequentially and therefore they are easy to implement in the computer’s memory. E.g. Arrays.  Non-Linear Data Structures:-In nonlinear data structures, a data element can be attached to several other data elements to represent specific relationships that exist among them. E.g. Graphs Department of CSE 7
  • 8. Array & Linked List Department of CSE 8 [0] [1] [2] A B CArray linked A B CLinked list Linked lists are unbounded (maximum number of items limited only by memory) node
  • 9. Stack  Stack ◦ New nodes can be added and removed only at the top ◦ Similar to a pile of dishes ◦ Last-in, first-out (LIFO)  push ◦ Adds a new node to the top of the stack  pop ◦ Removes a node from the top Department of CSE 9
  • 10. Stack  A stack is a list in which insertion and deletion take place at the same end ◦ This end is called top ◦ The other end is called bottom. Department of CSE 10
  • 11. Queue  Queue ◦ Similar to a supermarket checkout line ◦ First-in, first-out (FIFO) ◦ Nodes are removed only from the head ◦ Nodes are inserted only at the tail  Insert and remove operations ◦ Enqueue (insert) and dequeue (remove) Department of CSE 11
  • 12. The Queue Operations  A queue is like a line of people waiting for a bank teller. The queue has a front and a rear. Department of CSE 12 $ $ Front(Removal)Rear(insertion) Walking out
  • 13. Tree A tree T is a finite non empty set of elements. One of these elements is called the root, and the remaining elements, if any, are portioned into trees, which are called the sub trees of T. Department of CSE 13
  • 15. Graph  A graph is defined as: “Graph G is a ordered set (V,E), where V(G) represent the set of elements, called vertices, and E(G) represents the edges between these vertices.”  Graphs can be ◦ Undirected ◦ Directed Department of CSE 15
  • 16. Graph Figure shows a sample graph V(G)={v1,v2,v3,v4,v5} E(G)={e1,e2,e3,e4,e5} Department of CSE 16 v1 v5 v4 v2 v3 e2 e1 e5 e4 e3 Fig . (a) Undirected Graph
  • 17. Graph Department of CSE 17 v1 v5 v4 v2 v3 e2 e1 e5 e4 e3 Fig. (b) Directed Graph In directed graph, an edge is represented by an ordered pair (u,v) (i.e.=(u,v)), that can be traversed only from u toward v.
  • 18. Data Structure Operations Five major operations are associated with all data structures. i. Creation:- Initialization of the beginning. ii. Insertion: - Insertion means adding new details or new node into the data structure. iii. Deletion: - Deletion means removing a node from the data structure. iv. Traversal: - Traversing means accessing each node exactly once so that the nodes of a data structure can be processed. Traversing is also called as visiting. v. Searching: - Searching means finding the location of node for a given key value. Department of CSE 18
  • 19. Data Structure Operations(contd..)  Apart from the four operations mentioned above, there are two more operations occasionally performed on data structures. They are: (a) Sorting: -Sorting means arranging the data in a particular order. (b) Merging: - Merging means joining two lists. Department of CSE 19
  • 20. A first look on ADTs  Solving a problem involves processing data, and an important part of the solution is the efficient organization of the data  In order to do that, we need to identify: 1. The collection of data items 2. Basic operation that must be performed on them
  • 21. Abstract Data Type (ADT)  The word “abstract” refers to the fact that the data and the basic operations defined on it are being studied independently of how they are implemented  We think about what can be done with the data, not how it is done
  • 22. Primitive Data Type vs ADT Department of CSE 22
  • 23. Some ADT’s Some user defined ADT’s are  Stacks  Queues Department of CSE 23
  • 24. Stack ADT We define a stack as an ADT as shown below: Department of CSE 24
  • 25. Queue ADT We define a queue as an ADT as shown below: Department of CSE 25