SlideShare une entreprise Scribd logo
1  sur  23
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

Contenu connexe

Similaire à Unit 1 Data Structures Introduction L1.pptx

Data Structures unit I Introduction - data types
Data Structures unit I Introduction - data typesData Structures unit I Introduction - data types
Data Structures unit I Introduction - data typesAmirthaVarshini80
 
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
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureZaid Shabbir
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - IntroductionDeepaThirumurugan
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxsarala9
 
DATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptxDATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptxShivamKrPathak
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
 
introduction about data structure_i.pptx
introduction about data structure_i.pptxintroduction about data structure_i.pptx
introduction about data structure_i.pptxpoonamsngr
 
Data structure
Data structureData structure
Data structureMohd Arif
 
chapter three ppt.pptx
chapter three ppt.pptxchapter three ppt.pptx
chapter three ppt.pptxselemonGamo
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)ShrushtiGole
 
Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)pushpalathakrishnan
 
1. Data structures introduction
1. Data structures introduction1. Data structures introduction
1. Data structures introductionMandeep Singh
 
2.02.Data_structures_and_algorithms (1).pptx
2.02.Data_structures_and_algorithms (1).pptx2.02.Data_structures_and_algorithms (1).pptx
2.02.Data_structures_and_algorithms (1).pptxDrBashirMSaad
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductionsirshad17
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureRai University
 

Similaire à Unit 1 Data Structures Introduction L1.pptx (20)

Data Structures unit I Introduction - data types
Data Structures unit I Introduction - data typesData Structures unit I Introduction - data types
Data Structures unit I Introduction - data types
 
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
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - Introduction
 
Data structure
Data structureData structure
Data structure
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
 
DATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptxDATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptx
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 
introduction about data structure_i.pptx
introduction about data structure_i.pptxintroduction about data structure_i.pptx
introduction about data structure_i.pptx
 
Data structure
Data structureData structure
Data structure
 
chapter three ppt.pptx
chapter three ppt.pptxchapter three ppt.pptx
chapter three ppt.pptx
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
 
Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)Data Structure Question Bank(2 marks)
Data Structure Question Bank(2 marks)
 
1. Data structures introduction
1. Data structures introduction1. Data structures introduction
1. Data structures introduction
 
2.02.Data_structures_and_algorithms (1).pptx
2.02.Data_structures_and_algorithms (1).pptx2.02.Data_structures_and_algorithms (1).pptx
2.02.Data_structures_and_algorithms (1).pptx
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductions
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 

Dernier

Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Mark Carrigan
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff17thcssbs2
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17Celine George
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfbu07226
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45MysoreMuleSoftMeetup
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Morse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxMorse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxjmorse8
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17Celine George
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxheathfieldcps1
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryCeline George
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxNehaChandwani11
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPragya - UEM Kolkata Quiz Club
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 
Essential Safety precautions during monsoon season
Essential Safety precautions during monsoon seasonEssential Safety precautions during monsoon season
Essential Safety precautions during monsoon seasonMayur Khatri
 
REPRODUCTIVE TOXICITY STUDIE OF MALE AND FEMALEpptx
REPRODUCTIVE TOXICITY  STUDIE OF MALE AND FEMALEpptxREPRODUCTIVE TOXICITY  STUDIE OF MALE AND FEMALEpptx
REPRODUCTIVE TOXICITY STUDIE OF MALE AND FEMALEpptxmanishaJyala2
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Denish Jangid
 

Dernier (20)

Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Morse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxMorse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptx
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdf
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdfPost Exam Fun(da) Intra UEM General Quiz - Finals.pdf
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdf
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
Essential Safety precautions during monsoon season
Essential Safety precautions during monsoon seasonEssential Safety precautions during monsoon season
Essential Safety precautions during monsoon season
 
REPRODUCTIVE TOXICITY STUDIE OF MALE AND FEMALEpptx
REPRODUCTIVE TOXICITY  STUDIE OF MALE AND FEMALEpptxREPRODUCTIVE TOXICITY  STUDIE OF MALE AND FEMALEpptx
REPRODUCTIVE TOXICITY STUDIE OF MALE AND FEMALEpptx
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 

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