SlideShare a Scribd company logo
By:
Ritika Sharma
Assistant Professor
CSED, MAIT
MAU
8/14/2023 1
Ritika Sharma
 Data Structure . – A data structure is a
particular way of storing & organizing data in
a computer so that it can be used efficiently.
 A scheme for organizing related pieces of
information.
 Data Structure are generally based on the
ability of a computer to fetch and store data
at any place in its memory.
 A data str. is a group of data elements
grouped together under one name.
8/14/2023
Ritika Sharma 2
 Human requirement with computer are going
to complex day by day. To solve the complex
requirements in efficient way we need this
study.
 Provide fastest solution of human
requirements.
 Provide efficient solution of complex
problem.
– Space
– Time
8/14/2023
Ritika Sharma 3
 DBMS- ?
 Compiler Design-?
 Artificial Intelligence-?
 Operating Systems-?
 Network Analysis etc.
8/14/2023
Ritika Sharma 4
 Logical or mathematical description of the
structure.
 Implementation of structure on a computer
using different computer languages ( C, C++,
JAVA, pl-languages etc.)
 Quantitative analysis of the structure, which
includes determining the amount of memory
needed to store the structure and the time
required to process the structure.
(Complexity).
8/14/2023
Ritika Sharma 5
8/14/2023
Ritika Sharma 6
 1. According to Nature of Size
i) Static Data Structure:- A data Structure is
said to be if we can store data up to a fix
number e.g., array.
ii) Dynamic Data Structure:- which allows the
programmer to change its size during program
execution to add or delete data.
 2. According to its Occurrence:-
i) Linear DS:- here, data is stored in
consecutive memory locations or in sequential
from, e.g., array, link-list, stack, queue..
8/14/2023
Ritika Sharma 7
ii) Non- Linear DS:- The data items are not
arranged in a sequential structure. Ex: Trees,
Graphs.
 3. Primitive or Non Primitive Data structures
i) Primitive:- these are the basic data Structures
and directly operated on the machines, e.g., int,
float, char, strings etc.
ii) Non-Primitive Data structures:- They are
derived from the primitive data str. They can be
grouped as homogeneous or heterogeneous. Ex:
Array, Linked list, trees, graphs .
8/14/2023
Ritika Sharma 8
 Creating:- declaration and initialization of data
str. and reserved memory location for data
elements
 Inserting:- Adding new records to the structure.
 Deleting:- removing records from the ds.
 Updating:- It changes the data values of the ds.
 Traversing:- Accessing each record of ds exactly
once.
 Searching:- finding records
 Sorting:- Arranging records
 Merging:- Combining records of two diffn DS.
8/14/2023
Ritika Sharma 9
 Array: is commonly used in computer
programming to mean a contiguous block of
memory locations, where each memory
location stores one fixed-length data item.
e.g. Array of Integers int a[10], Array of
Character char b[10]
8/14/2023
Ritika Sharma 10
 Stack: A stack is a data structure in which
items can be inserted only from one end and
get items back from the same end. There ,
the last item inserted into stack, is the the
first item to be taken out from the stack. In
short its also called Last in First out [LIFO].

8/14/2023
Ritika Sharma 11
 Queue: A queue is two ended data structure
in which items can be inserted from one end
and taken out from the other end. Therefore ,
the first item inserted into queue is the first
item to be taken out from the queue. This
property is called First in First out [FIFO].
8/14/2023
Ritika Sharma 12
 Linked List: Could alternately used to store
items. In linked list space to store items is
created as is needed and destroyed when
space no longer required to store items.
Hence linked list is a dynamic data structure
space acquire only when need.
8/14/2023
Ritika Sharma 13
 Tree: is a non-linear data structure which is
mainly used to represent data containing a
hierarchical relationship between elements.
 Binary Tree: A binary tree is a tree such that
every node has at most 2 child and each node
is labeled as either left of right child
8/14/2023
Ritika Sharma 14
 Graph: It is a set of items connected by edges.
Each item is called a vertex or node. Trees are
just like a special kinds of graphs. Graphs are
usually represented by G = (V, E), where V is the
set vertices and E is the set of Edges.
 Undirected Graph: A graph whose edges are
unordered pair of vertices. That is each edge
connects two vertices. In an undirected graph,
direction is not important, if the path is available,
it can be traversed in any direction
8/14/2023
Ritika Sharma 15
 Directed Graph: In directed graph a
directional edge connect two node/vertex. If
there is one edge from one vertex to other
then only this path can be followed
 Weighted Graph: A graph having a weight, or
number associated with each edge
8/14/2023
Ritika Sharma 16
 An Algorithm is a precise plan for performing
a sequence of actions to achieve the intended
purpose. Each action is drawn from a well-
understood selection on data.
 Defn:- An algorithm is a step by step finite
sequence of instructions, to solve a well
defined computational problems.
 Features:
 It should be free of ambiguity
 It should be precise.
 It should be efficient.
8/14/2023
Ritika Sharma 17
 After designing an algorithm, it has to be
checked and its correctness need to be
predicted; this is done by analyzing the
algorithm. Algorithm analysis means
measures the efficiency of the algorithm.
 A) Types of Analysis:
1. Worst case running time
2. Average case running time
3. Best case running time
8/14/2023
Ritika Sharma 18
 In the worst case analysis, we calculate upper
bound on running time of an algorithm. We
must know the case that causes maximum
number of operations to be executed.
 For example in Linear Search, the worst case
happens when the element to be searched (x)
is not present in the array. When x is not
present, the search() functions compares it
with all the elements of arr[] one by one.
Therefore, the worst case time complexity of
linear search would be “n”.
8/14/2023
Ritika Sharma 19
 In average case analysis, we take all possible
inputs and calculate computing time for all of
the inputs. Sum all the calculated values and
divide the sum by total number of inputs.
 For the linear search problem, let us assume
that all cases are uniformly
distributed (including the case of x not being
present in array). So we sum all the cases and
divide the sum by (n+1).
8/14/2023
Ritika Sharma 20
 In the best case analysis, we calculate lower
bound on running time of an algorithm. We
must know the case that causes minimum
number of operations to be executed. In the
linear search problem, the best case occurs
when x is present at the first location. The
number of operations in the best case is
constant (not dependent on n). So time
complexity in the best case would be Θ(1)
8/14/2023
Ritika Sharma 21
 It refers to a choice between algorithmic
solutions of a data processing problem that
allows one to decrease the running time of an
algorithm solution by increasing the space to
store data and vice versa.
 For example- we may have to choose a data
str. That requires a less memory and less
time to execute a problem.
8/14/2023
Ritika Sharma 22
 Time Complexity:- An algorithm A for a
problem P is said to have time complexity of
T(n) if the number of steps required to
complete its run for an input of size n is
always less than equal to T(n).
 Space Complexity:- An algorithm A for a
problem P is said to have space complexity of
S(n) if the number of bits required to
complete its run for an input of size n is
always less than equal to S(n).
8/14/2023
Ritika Sharma 23

More Related Content

PPT
ds 1 Introduction to Data Structures.ppt
AlliVinay1
 
PPTX
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
PPTX
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
PPTX
Data Structures unit I Introduction - data types
AmirthaVarshini80
 
PPTX
Array Data StructureData StructureData Structure.pptx
menukam354
 
PPTX
Data structures - Introduction
DeepaThirumurugan
 
PPTX
Chapter 1 Data structure _Algorithms.pptx
BifaHirpo1
 
ds 1 Introduction to Data Structures.ppt
AlliVinay1
 
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
Data Structures unit I Introduction - data types
AmirthaVarshini80
 
Array Data StructureData StructureData Structure.pptx
menukam354
 
Data structures - Introduction
DeepaThirumurugan
 
Chapter 1 Data structure _Algorithms.pptx
BifaHirpo1
 

Similar to Unit 1 Data Structures Introduction L1.pptx (20)

PDF
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 
PPTX
19. Java data structures algorithms and complexity
Intro C# Book
 
PPT
algo 1.ppt
example43
 
PPTX
data structure and algoriythm pres.pptxD
dubaay100
 
PPTX
19. Data Structures and Algorithm Complexity
Intro C# Book
 
PDF
X Chapter 1 Problem Solving and Algorithm Designing.pdf
Amna Nawazish
 
PPTX
Data Structure.pptx
SajalFayyaz
 
PPT
Lecture#1(Algorithmic Notations).ppt
MuhammadTalhaAwan1
 
DOCX
Data structure and algorithm.
Abdul salam
 
PPTX
EE-232-LEC-01 Data_structures.pptx
iamultapromax
 
PDF
U nit i data structure-converted
Shri Shankaracharya College, Bhilai,Junwani
 
PPTX
Intro to Data Structure & Algorithms
Akhil Kaushik
 
PPTX
Lecture 01 Intro to DSA
Nurjahan Nipa
 
PDF
Data structure and Alogorithm analysis unit one
DawitAbera8
 
PPTX
8.unit-1-fds-2022-23.pptx
RavishankarBhaganaga
 
PPTX
Data Structures and Algorithm - Module 1.pptx
EllenGrace9
 
PDF
Unit I Data structure and algorithms notes
FIONACHATOLA
 
PDF
Unit 1 OF DS FOR AI DS BTRCH OF DS FOR AI DS BTRCH .pdf
prathamsingh33
 
PDF
Data structures and algorithms Module-1.pdf
DukeCalvin
 
PPTX
Lecture 1 and 2
SaheedTundeZubairSTA
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 
19. Java data structures algorithms and complexity
Intro C# Book
 
algo 1.ppt
example43
 
data structure and algoriythm pres.pptxD
dubaay100
 
19. Data Structures and Algorithm Complexity
Intro C# Book
 
X Chapter 1 Problem Solving and Algorithm Designing.pdf
Amna Nawazish
 
Data Structure.pptx
SajalFayyaz
 
Lecture#1(Algorithmic Notations).ppt
MuhammadTalhaAwan1
 
Data structure and algorithm.
Abdul salam
 
EE-232-LEC-01 Data_structures.pptx
iamultapromax
 
U nit i data structure-converted
Shri Shankaracharya College, Bhilai,Junwani
 
Intro to Data Structure & Algorithms
Akhil Kaushik
 
Lecture 01 Intro to DSA
Nurjahan Nipa
 
Data structure and Alogorithm analysis unit one
DawitAbera8
 
8.unit-1-fds-2022-23.pptx
RavishankarBhaganaga
 
Data Structures and Algorithm - Module 1.pptx
EllenGrace9
 
Unit I Data structure and algorithms notes
FIONACHATOLA
 
Unit 1 OF DS FOR AI DS BTRCH OF DS FOR AI DS BTRCH .pdf
prathamsingh33
 
Data structures and algorithms Module-1.pdf
DukeCalvin
 
Lecture 1 and 2
SaheedTundeZubairSTA
 
Ad

Recently uploaded (20)

PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
Basics and rules of probability with real-life uses
ravatkaran694
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Ad

Unit 1 Data Structures Introduction L1.pptx

  • 1. By: Ritika Sharma Assistant Professor CSED, MAIT MAU 8/14/2023 1 Ritika Sharma
  • 2.  Data Structure . – A data structure is a particular way of storing & organizing data in a computer so that it can be used efficiently.  A scheme for organizing related pieces of information.  Data Structure are generally based on the ability of a computer to fetch and store data at any place in its memory.  A data str. is a group of data elements grouped together under one name. 8/14/2023 Ritika Sharma 2
  • 3.  Human requirement with computer are going to complex day by day. To solve the complex requirements in efficient way we need this study.  Provide fastest solution of human requirements.  Provide efficient solution of complex problem. – Space – Time 8/14/2023 Ritika Sharma 3
  • 4.  DBMS- ?  Compiler Design-?  Artificial Intelligence-?  Operating Systems-?  Network Analysis etc. 8/14/2023 Ritika Sharma 4
  • 5.  Logical or mathematical description of the structure.  Implementation of structure on a computer using different computer languages ( C, C++, JAVA, pl-languages etc.)  Quantitative analysis of the structure, which includes determining the amount of memory needed to store the structure and the time required to process the structure. (Complexity). 8/14/2023 Ritika Sharma 5
  • 7.  1. According to Nature of Size i) Static Data Structure:- A data Structure is said to be if we can store data up to a fix number e.g., array. ii) Dynamic Data Structure:- which allows the programmer to change its size during program execution to add or delete data.  2. According to its Occurrence:- i) Linear DS:- here, data is stored in consecutive memory locations or in sequential from, e.g., array, link-list, stack, queue.. 8/14/2023 Ritika Sharma 7
  • 8. ii) Non- Linear DS:- The data items are not arranged in a sequential structure. Ex: Trees, Graphs.  3. Primitive or Non Primitive Data structures i) Primitive:- these are the basic data Structures and directly operated on the machines, e.g., int, float, char, strings etc. ii) Non-Primitive Data structures:- They are derived from the primitive data str. They can be grouped as homogeneous or heterogeneous. Ex: Array, Linked list, trees, graphs . 8/14/2023 Ritika Sharma 8
  • 9.  Creating:- declaration and initialization of data str. and reserved memory location for data elements  Inserting:- Adding new records to the structure.  Deleting:- removing records from the ds.  Updating:- It changes the data values of the ds.  Traversing:- Accessing each record of ds exactly once.  Searching:- finding records  Sorting:- Arranging records  Merging:- Combining records of two diffn DS. 8/14/2023 Ritika Sharma 9
  • 10.  Array: is commonly used in computer programming to mean a contiguous block of memory locations, where each memory location stores one fixed-length data item. e.g. Array of Integers int a[10], Array of Character char b[10] 8/14/2023 Ritika Sharma 10
  • 11.  Stack: A stack is a data structure in which items can be inserted only from one end and get items back from the same end. There , the last item inserted into stack, is the the first item to be taken out from the stack. In short its also called Last in First out [LIFO].  8/14/2023 Ritika Sharma 11
  • 12.  Queue: A queue is two ended data structure in which items can be inserted from one end and taken out from the other end. Therefore , the first item inserted into queue is the first item to be taken out from the queue. This property is called First in First out [FIFO]. 8/14/2023 Ritika Sharma 12
  • 13.  Linked List: Could alternately used to store items. In linked list space to store items is created as is needed and destroyed when space no longer required to store items. Hence linked list is a dynamic data structure space acquire only when need. 8/14/2023 Ritika Sharma 13
  • 14.  Tree: is a non-linear data structure which is mainly used to represent data containing a hierarchical relationship between elements.  Binary Tree: A binary tree is a tree such that every node has at most 2 child and each node is labeled as either left of right child 8/14/2023 Ritika Sharma 14
  • 15.  Graph: It is a set of items connected by edges. Each item is called a vertex or node. Trees are just like a special kinds of graphs. Graphs are usually represented by G = (V, E), where V is the set vertices and E is the set of Edges.  Undirected Graph: A graph whose edges are unordered pair of vertices. That is each edge connects two vertices. In an undirected graph, direction is not important, if the path is available, it can be traversed in any direction 8/14/2023 Ritika Sharma 15
  • 16.  Directed Graph: In directed graph a directional edge connect two node/vertex. If there is one edge from one vertex to other then only this path can be followed  Weighted Graph: A graph having a weight, or number associated with each edge 8/14/2023 Ritika Sharma 16
  • 17.  An Algorithm is a precise plan for performing a sequence of actions to achieve the intended purpose. Each action is drawn from a well- understood selection on data.  Defn:- An algorithm is a step by step finite sequence of instructions, to solve a well defined computational problems.  Features:  It should be free of ambiguity  It should be precise.  It should be efficient. 8/14/2023 Ritika Sharma 17
  • 18.  After designing an algorithm, it has to be checked and its correctness need to be predicted; this is done by analyzing the algorithm. Algorithm analysis means measures the efficiency of the algorithm.  A) Types of Analysis: 1. Worst case running time 2. Average case running time 3. Best case running time 8/14/2023 Ritika Sharma 18
  • 19.  In the worst case analysis, we calculate upper bound on running time of an algorithm. We must know the case that causes maximum number of operations to be executed.  For example in Linear Search, the worst case happens when the element to be searched (x) is not present in the array. When x is not present, the search() functions compares it with all the elements of arr[] one by one. Therefore, the worst case time complexity of linear search would be “n”. 8/14/2023 Ritika Sharma 19
  • 20.  In average case analysis, we take all possible inputs and calculate computing time for all of the inputs. Sum all the calculated values and divide the sum by total number of inputs.  For the linear search problem, let us assume that all cases are uniformly distributed (including the case of x not being present in array). So we sum all the cases and divide the sum by (n+1). 8/14/2023 Ritika Sharma 20
  • 21.  In the best case analysis, we calculate lower bound on running time of an algorithm. We must know the case that causes minimum number of operations to be executed. In the linear search problem, the best case occurs when x is present at the first location. The number of operations in the best case is constant (not dependent on n). So time complexity in the best case would be Θ(1) 8/14/2023 Ritika Sharma 21
  • 22.  It refers to a choice between algorithmic solutions of a data processing problem that allows one to decrease the running time of an algorithm solution by increasing the space to store data and vice versa.  For example- we may have to choose a data str. That requires a less memory and less time to execute a problem. 8/14/2023 Ritika Sharma 22
  • 23.  Time Complexity:- An algorithm A for a problem P is said to have time complexity of T(n) if the number of steps required to complete its run for an input of size n is always less than equal to T(n).  Space Complexity:- An algorithm A for a problem P is said to have space complexity of S(n) if the number of bits required to complete its run for an input of size n is always less than equal to S(n). 8/14/2023 Ritika Sharma 23