SlideShare a Scribd company logo
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.ppt
Topics to be discussed
 Introduction to Algorithm
 Algorithm Design
 Complexity
 Asymptotic notations
 Introduction to Data Structures
 Classification of Data structure
 Abstract Data Type (ADT)
Introduction to Algorithm
 An algorithm is a Step By Step process to solve a
problem, where each step indicates an intermediate task.
Algorithm contains finite number of steps that leads to the
solution of the problem.
Structure of an Algorithm
An algorithm has the following structure
 Input Step
 Assignment Step
 Decision Step
 Repetitive Step
 Output Step
Properties /Characteristics of
an Algorithm
Algorithm has the following basic properties
 Input-Output:- Algorithm takes ‘0’ or more input and
produces the required output. This is the basic
characteristic of an algorithm.
 Finiteness:- An algorithm must terminate in countable
number of steps.
Properties /Characteristics of
an Algorithm
 Definiteness: Each step of an algorithm must be stated
clearly and unambiguously.
 Effectiveness: Each and every step in an algorithm can be
converted in to programming language statement.
 Generality: Algorithm is generalized one. It works on all
set of inputs and provides the required output. In other
words it is not restricted to a single input value.
Categories of Algorithm
Based on the different types of steps in an Algorithm, it
can be divided into three categories, namely
 Sequence
 Selection and
 Iteration
Categories of Algorithm
Sequence: The steps described in an algorithm are performed
successively one by one without skipping any step. The sequence
of steps defined in an algorithm should be simple and easy to
understand. Each instruction of such an algorithm is executed,
because no selection procedure or conditional branching exists in
a sequence algorithm.
 Example:
 // adding two numbers
 Step 1: start
 Step 2: read a,b
 Step 3: Sum=a+b
 Step 4: write Sum
 Step 5: stop
Categories of Algorithm
Selection: The sequence type of algorithms are not
sufficient to solve the problems, which involves decision
and conditions. In order to solve the problem which involve
decision making or option selection, we go for Selection
type of algorithm. The general format of Selection type of
statement is as shown below:
 if(condition)
 Statement-1;
 else
 Statement-2;
Categories of Algorithm
Categories of Algorithm
Iteration: Iteration type algorithms are used in solving the
problems which involves repetition of statement. In this type
of algorithms, a particular number of statements are repeated
‘n’ no. of times.
 Example1:
 Step 1 : start
 Step 2 : read n
 Step 3 : repeat step 4 until n>0
 Step 4 : (a) r=n mod 10
 (b) s=s+r
 (c) n=n/10
 Step 5 : write s
 Step 6 : stop
Algorithm Design
 Precisely define the problem. Precisely specify the input
and output. Consider all cases.
 Come up with a simple plan to solve the problem at hand.
The plan is independent of a (programming) language.
The precise problem specification influences the plan.
 Turn the plan into an implementation – The problem
representation (data structure) influences the
implementation
Classification by Design Method
 Greedy Method
 Divide and Conquer
 Dynamic Programming
 Backtracking
 Branch and Bound
Classification by Design Approaches
 Top-Down Approach: In the top-down approach, a
large problem is divided into small sub-problem. and
keep repeating the process of decomposing problems
until the complex problem is solved.
 Bottom-up approach: The bottom-up approach is also
known as the reverse of top-down approaches.
In approach different, part of a complex program is
solved using a programming language and then this is
combined into a complete program.
1.Write an algorithm for roots of a Quadratic Equation?
 // Roots of a quadratic Equation
 Step 1 : start
 Step 2 : read a,b,c
 Step 3 : if (a= 0) then step 4 else step 5
 Step 4 : Write “ Given equation is a linear equation “
 Step 5 : d=(b * b) _ (4 *a *c)
 Step 6 : if ( d>0) then step 7 else step8
 Step 7 : Write “ Roots are real and Distinct”
 Step 8: if(d=0) then step 9 else step 10
 Step 9: Write “Roots are real and equal”
 Step 10: Write “ Roots are Imaginary”
 Step 11: stop
2. Write an algorithm to find the largest among three different numbers
entered by user
 Step 1: Start
 Step 2: Declare variables a,b and c.
 Step 3: Read variables a,b and c.
 Step 4: If a>b
 If a>c
 Display a is the largest number.
 Else
 Display c is the largest number.
 Else
 If b>c
 Display b is the largest number.
 Else
 Display c is the greatest number.
 Step 5: Stop
Complexity of Algorithm
 Algorithmic complexity is concerned about how fast or
slow particular algorithm performs. We define complexity
as a numerical function T(n) - time versus the input size n.
Performance Analysis an Algorithm:
 The Efficiency of an Algorithm can be measured by the
following metrics.
Time Complexity:
 The amount of time required for an algorithm to complete
its execution is its time complexity. An algorithm is said to
be efficient if it takes the minimum (reasonable) amount
of time to complete its execution.
Complexity of Algorithm
Space Complexity:
 The amount of space occupied by an algorithm is known
as Space Complexity. An algorithm is said to be efficient
if it occupies less space and required the minimum amount
of time to complete its execution.
Example
Example
The total frequency counts of the program segments A, B and C given by 1,
(3n+1) and (3n2+3n+1) respectively are expressed as O(1), O(n) and O(n2)
Asymptotic Notations
 Asymptotic notations are the mathematical notations used
to describe the running time of an algorithm when the
input tends towards a particular value or a limiting value.
 It is often used to describe how the size of the input data
affects an algorithm’s usage of computational resources.
 The time required by an algorithm falls under three types
Best Case − Minimum time required for program
execution.
 Average Case − Average time required for program
execution.
 Worst Case − Maximum time required for program
execution.
Asymptotic Notations
 The time required by an algorithm falls under three types
Best Case − Minimum time required for program
execution.
 Average Case − Average time required for program
execution.
 Worst Case − Maximum time required for program
execution.
Types of Asymptotic Notations
There are mainly three asymptotic notations:
1.Big-O Notation (O-notation)
2.Omega Notation (Ω-notation)
3.Theta Notation (Θ-notation)
Big-O Notation (O-notation)
 Big-O notation represents the upper bound of the running
time of an algorithm. It measures the worst case time
complexity or the longest amount of time an algorithm can
possibly take to complete.
Asymptotic Notations
 If f(n) describes the running time of an algorithm, f(n) is
O(g(n)) if there exist a positive constant C and positive
integer n0 such that, 0 ≤ f(n) ≤ cg(n) for all n ≥ n0
 Example: Find upper bound of running time of constant
function f(n) = 6993.
 To find the upper bound of f(n), we have to find c and
n0 such that 0 ≤ f (n) ≤ c.g(n) for all n ≥ n0
 0 ≤ f (n) ≤ c × g (n)
 0 ≤ 6993 ≤ c × g (n)
 0 ≤ 6993 ≤ 6993 x 1
 So, c = 6993 and g(n) = 1
 Any value of c which is greater than 6993, satisfies the
above inequalities, so all such values of c are possible.
 0 ≤ 6993 ≤ 8000 x 1 → true
 0 ≤ 6993 ≤ 10500 x 1 → true
 Function f(n) is constant, so it does not depend on
problem size n. So n0= 1
 f(n) = O(g(n)) = O(1) for c = 6993, n0 = 1
 f(n) = O(g(n)) = O(1) for c = 8000, n0 = 1 and so on.
 Example: Find upper bound of running time of a linear
function f(n) = 6n + 3.
 To find upper bound of f(n), we have to find c and n0 such
that 0 ≤ f (n) ≤ c × g (n) for all n ≥ n0
 0 ≤ f (n) ≤ c × g (n)
 0 ≤ 6n + 3 ≤ c × g (n)
 0 ≤ 6n + 3 ≤ 6n + 3n, for all n ≥ 1 (There can be such
infinite possibilities)
 0 ≤ 6n + 3 ≤ 9n
 So, c = 9 and g (n) = n, n0 = 1
 Tabular Approach
 0 ≤ 6n + 3 ≤ c × g (n)
 0 ≤ 6n + 3 ≤ 7 n
 Now, manually find out the proper n0, such that f (n) ≤ c.g
(n)
n f(n) = 6n + 3 c.g(n) = 7n
1 9 7
2 15 14
3 21 21
4 27 28
5 33 35
 From Table, for n ≥ 3, f (n) ≤ c × g (n) holds true. So, c =
7, g(n) = n and n0 = 3, There can be such multiple pair of
(c, n0)
 f(n) = O(g(n)) = O(n) for c = 9, n0 = 1
 f(n) = O(g(n)) = O(n) for c = 7, n0 = 3
 and so on.
Omega Notation (Ω-Notation)
 Omega notation represents the lower bound of the running
time of an algorithm. It measures the best case time
complexity or the best amount of time an algorithm can
possibly take to complete.
 If f(n) describes the running time of an algorithm, The
function f is said to be Ω(g), if there is a constant c > 0
and a natural number n0 such that c*g(n) ≤ f(n) for all n ≥
n0
Omega Notation (Ω-Notation)
Example
 Find lower bound of running time of constant
function f(n) = 23.
 To find lower bound of f(n), we have to find c and
n0 such that { 0 ≤ c × g(n) ≤ f(n) for all n ≥ n0 }
 0 ≤ c × g(n) ≤ f(n)
 0 ≤ c × g(n) ≤ 23
 0 ≤ 23.1 ≤ 23 → true
 0 ≤ 12.1 ≤ 23 → true
 0 ≤ 5.1 ≤ 23 → true
Example: Find lower bound of running time of a linear
function f(n) = 6n + 3.
 To find lower bound of f(n), we have to find c and n0 such
that 0 ≤ c.g(n) ≤ f(n) for all n ≥ n0
 0 ≤ c × g(n) ≤ f(n)
 0 ≤ c × g(n) ≤ 6n + 3
 0 ≤ 6n ≤ 6n + 3 → true, for all n ≥ n0
 0 ≤ 5n ≤ 6n + 3 → true, for all n ≥ n0
 Above both inequalities are true and there exists such
infinite inequalities. So,
 f(n) = Ω (g(n)) = Ω (n) for c = 6, n0 = 1
 f(n) = Ω (g(n)) = Ω (n) for c = 5, n0 = 1
 and so on.
Theta Notation (Θ-Notation)
 Theta notation represents the represents the upper and the
lower bound of the running time of an algorithm, it is used
for analyzing the average-case complexity of an
algorithm.
 The function f is said to be Θ(g), if there are constants c1,
c2 > 0 and a natural number n0 such that c1* g(n) ≤ f(n) ≤
c2 * g(n) for all n ≥ n0
 Theta Notation (Θ-Notation)
 Find tight bound of running time of constant function f(n)
= 23.
 To find tight bound of f(n), we have to find c1, c2 and
n0 such that, 0 ≤ c1× g(n) ≤ f(n) ≤ c2 × g(n) for all n ≥ n0
 0 ≤ c1× g(n) ≤ 23 ≤ c2 × g(n)
 0 ≤ 22 ×1 ≤ 23 ≤ 24 × 1, → true for all n ≥ 1
 0 ≤ 10 ×1 ≤ 23 ≤ 50 × 1, → true for all n ≥ 1
 Above both inequalities are true and there exists such
infinite inequalities.
 So, (c1, c2) = (22, 24) and g(n) = 1, for all n ≥ 1
 (c1, c2) = (10, 50) and g(n) = 1, for all n ≥ 1
 f(n) = Θ (g (n)) = Θ (1) for c1 = 22, c2 = 24, n0 = 1
 f(n) = Θ (g (n)) = Θ (1) for c1 = 10, c2 = 50, n0 = 1
 and so on.
 Example: Find tight bound of running time of a linear
function f(n) = 6n + 3.
 To find tight bound of f(n), we have to find c1, c2 and
n0 such that, 0 ≤ c1× g(n) ≤ f(n) ≤ c2 × g(n) for all n ≥ n0
 0 ≤ c1× g(n) ≤ 6n + 3 ≤ c2 × g(n)
 0 ≤ 5n ≤ 6n + 3 ≤ 9n, for all n ≥ 1
 Above inequality is true and there exists such infinite
inequalities.
 So, f(n) = Θ(g(n)) = Θ(n) for c1 = 5, c2 = 9, n0 = 1
Data Structure
 Data structure is a representation of data and the
operations allowed on that data.
 Data structure is a way to store and organize data in order
to facilitate the access and modifications.
 Data Structure are the method of representing of logical
relationships between individual data elements related to
the solution of a given problem.
Operations on the Data Structures
Following operations can be performed on the data
structures:
 Traversing
 Searching
 Inserting
 Deleting
 Sorting
 Merging
Operations on the Data Structures
 Traversing- It is used to access each data item exactly once so
that it can be processed.
 Searching- It is used to find out the location of the data item if
it exists in the given collection of data items.
 Inserting- It is used to add a new data item in the given
collection of data items.
 Deleting- It is used to delete an existing data item from the
given collection of data items.
 Sorting- It is used to arrange the data items in some order i.e. in
ascending or descending order in case of numerical data and in
dictionary order in case of alphanumeric data.
 Merging- It is used to combine the data items of two sorted
files into single file in the sorted form.
Application of Data Structures
The following are some of the most important areas
where data structures are used:
 Artificial intelligence
 Compiler design
 Machine learning
 Database design and management
 Blockchain
 Numerical and Statistical analysis
 Operating system development
 Image & Speech Processing
 Cryptography
Basic Data Structure
array
Linked list
tree
queue
stack
Selection of Data Structure
 The choice of particular data model depends on two
consideration:
 It must be rich enough in structure to represent the
relationship between data elements
 The structure should be simple enough that one can
effectively process the data when necessary
Types of Data Structure
 Linear: In Linear data structure, values are arrange in
linear fashion.
 Array: Fixed-size
 Linked-list: Variable-size
 Stack: Add to top and remove from top
 Queue: Add to back and remove from front
 Priority queue: Add anywhere, remove the highest
priority
Types of Data Structure
 Non-Linear: The data values in this structure are not
arranged in order.
 Hash tables: Unordered lists which use a ‘hash
function’ to insert and search
 Tree: Data is organized in branches.
 Graph: A more general branching structure, with less
strict connection conditions than for a tree
Type of Data Structures
 Homogenous: In this type of data structures, values of the
same types of data are stored.
 Array
 Non-Homogenous: In this type of data structures, data
values of different types are grouped and stored.
 Structures
 Classes
Abstract Data Type and Data
Structure
 Definition:-
 Abstract Data Types (ADTs) stores data and allow various
operations on the data to access and change it.
 A mathematical model, together with various operations
defined on the model
 An ADT is a collection of data and associated operations for
manipulating that data
 Data Structures
 Physical implementation of an ADT
 data structures used in implementations are provided in a
language (primitive or built-in) or are built from the
language constructs (user-defined)
 Each operation associated with the ADT is implemented by
one or more subroutines in the implementation
Abstract Data Type(ADT)
 ADTs support abstraction, encapsulation, and information
hiding.
 Abstraction is the structuring of a problem into well-
defined entities by defining their data and operations.
 The principle of hiding the used data structure and to only
provide a well-defined interface is known as
encapsulation.
The Core Operations of ADT
 Every Collection ADT should provide a way to:
 add an item
 remove an item
 find, retrieve, or access an item
 Many, many more possibilities
 is the collection empty
 make the collection empty
 give me a sub set of the collection
The Core Operations of ADT
• No single data structure works well for all purposes, and
so it is important to know the strengths and limitations
of several of them
Stacks
 Collection with access only to the last element inserted
 Last in first out
 insert/push
 remove/pop
 top
 make empty
Top
Data4
Data3
Data2
Data1
Queues
 Collection with access only to the item that has been
present the longest
 Last in last out or first in first out
 enqueue, dequeue, front
 priority queues and dequeue
Data4
Data3
Data2
Data1
Front Back
List
 A Flexible structure, because can grow and shrink on
demand.
Elements can be:
 Inserted
 Accessed
 Deleted
At any position
first
last
Tree
 A Tree is a collection of elements called nodes.
 One of the node is distinguished as a root, along with a
relation (“parenthood”) that places a hierarchical structure
on the nodes.
Root
Ad

More Related Content

Similar to Data_Structure_and_Algorithms_Lecture_1.ppt (20)

Unit ii algorithm
Unit   ii algorithmUnit   ii algorithm
Unit ii algorithm
Tribhuvan University
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
Tanya Makkar
 
Analysis Framework, Asymptotic Notations
Analysis Framework, Asymptotic NotationsAnalysis Framework, Asymptotic Notations
Analysis Framework, Asymptotic Notations
DrSMeenakshiSundaram1
 
3 analysis.gtm
3 analysis.gtm3 analysis.gtm
3 analysis.gtm
Natarajan Angappan
 
Aad introduction
Aad introductionAad introduction
Aad introduction
Mr SMAK
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
MemMem25
 
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptxData Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
RashidFaridChishti
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematical
babuk110
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture Notes
Sreedhar Chowdam
 
Time complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjj
Time complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjjTime complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjj
Time complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjj
shesnasuneer
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
B.Kirron Reddi
 
Introduction to Design and Analysis of Algorithms
Introduction to Design and Analysis of AlgorithmsIntroduction to Design and Analysis of Algorithms
Introduction to Design and Analysis of Algorithms
ssusered62011
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
design analysis of algorithmaa unit 1.pptx
design analysis of algorithmaa unit 1.pptxdesign analysis of algorithmaa unit 1.pptx
design analysis of algorithmaa unit 1.pptx
rajesshs31r
 
Measuring algorithm performance
Measuring algorithm performanceMeasuring algorithm performance
Measuring algorithm performance
HabitamuAsimare
 
How to calculate complexity in Data Structure
How to calculate complexity in Data StructureHow to calculate complexity in Data Structure
How to calculate complexity in Data Structure
debasisdas225831
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
ibrahim386946
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
RobinRohit2
 
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
http://algorithmtraining.com/advanced-python-training-hyderabad/
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
Tanya Makkar
 
Analysis Framework, Asymptotic Notations
Analysis Framework, Asymptotic NotationsAnalysis Framework, Asymptotic Notations
Analysis Framework, Asymptotic Notations
DrSMeenakshiSundaram1
 
Aad introduction
Aad introductionAad introduction
Aad introduction
Mr SMAK
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
MemMem25
 
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptxData Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
RashidFaridChishti
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematical
babuk110
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture Notes
Sreedhar Chowdam
 
Time complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjj
Time complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjjTime complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjj
Time complexity.pptxghhhhhhhhhhhhhhhjjjjjjjjjjjjjjjjjjjjjjjjjj
shesnasuneer
 
Introduction to Design and Analysis of Algorithms
Introduction to Design and Analysis of AlgorithmsIntroduction to Design and Analysis of Algorithms
Introduction to Design and Analysis of Algorithms
ssusered62011
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
design analysis of algorithmaa unit 1.pptx
design analysis of algorithmaa unit 1.pptxdesign analysis of algorithmaa unit 1.pptx
design analysis of algorithmaa unit 1.pptx
rajesshs31r
 
Measuring algorithm performance
Measuring algorithm performanceMeasuring algorithm performance
Measuring algorithm performance
HabitamuAsimare
 
How to calculate complexity in Data Structure
How to calculate complexity in Data StructureHow to calculate complexity in Data Structure
How to calculate complexity in Data Structure
debasisdas225831
 

Recently uploaded (20)

Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Ad

Data_Structure_and_Algorithms_Lecture_1.ppt

  • 3. Topics to be discussed  Introduction to Algorithm  Algorithm Design  Complexity  Asymptotic notations  Introduction to Data Structures  Classification of Data structure  Abstract Data Type (ADT)
  • 4. Introduction to Algorithm  An algorithm is a Step By Step process to solve a problem, where each step indicates an intermediate task. Algorithm contains finite number of steps that leads to the solution of the problem.
  • 5. Structure of an Algorithm An algorithm has the following structure  Input Step  Assignment Step  Decision Step  Repetitive Step  Output Step
  • 6. Properties /Characteristics of an Algorithm Algorithm has the following basic properties  Input-Output:- Algorithm takes ‘0’ or more input and produces the required output. This is the basic characteristic of an algorithm.  Finiteness:- An algorithm must terminate in countable number of steps.
  • 7. Properties /Characteristics of an Algorithm  Definiteness: Each step of an algorithm must be stated clearly and unambiguously.  Effectiveness: Each and every step in an algorithm can be converted in to programming language statement.  Generality: Algorithm is generalized one. It works on all set of inputs and provides the required output. In other words it is not restricted to a single input value.
  • 8. Categories of Algorithm Based on the different types of steps in an Algorithm, it can be divided into three categories, namely  Sequence  Selection and  Iteration
  • 9. Categories of Algorithm Sequence: The steps described in an algorithm are performed successively one by one without skipping any step. The sequence of steps defined in an algorithm should be simple and easy to understand. Each instruction of such an algorithm is executed, because no selection procedure or conditional branching exists in a sequence algorithm.  Example:  // adding two numbers  Step 1: start  Step 2: read a,b  Step 3: Sum=a+b  Step 4: write Sum  Step 5: stop
  • 10. Categories of Algorithm Selection: The sequence type of algorithms are not sufficient to solve the problems, which involves decision and conditions. In order to solve the problem which involve decision making or option selection, we go for Selection type of algorithm. The general format of Selection type of statement is as shown below:  if(condition)  Statement-1;  else  Statement-2;
  • 12. Categories of Algorithm Iteration: Iteration type algorithms are used in solving the problems which involves repetition of statement. In this type of algorithms, a particular number of statements are repeated ‘n’ no. of times.  Example1:  Step 1 : start  Step 2 : read n  Step 3 : repeat step 4 until n>0  Step 4 : (a) r=n mod 10  (b) s=s+r  (c) n=n/10  Step 5 : write s  Step 6 : stop
  • 13. Algorithm Design  Precisely define the problem. Precisely specify the input and output. Consider all cases.  Come up with a simple plan to solve the problem at hand. The plan is independent of a (programming) language. The precise problem specification influences the plan.  Turn the plan into an implementation – The problem representation (data structure) influences the implementation
  • 14. Classification by Design Method  Greedy Method  Divide and Conquer  Dynamic Programming  Backtracking  Branch and Bound
  • 15. Classification by Design Approaches  Top-Down Approach: In the top-down approach, a large problem is divided into small sub-problem. and keep repeating the process of decomposing problems until the complex problem is solved.  Bottom-up approach: The bottom-up approach is also known as the reverse of top-down approaches. In approach different, part of a complex program is solved using a programming language and then this is combined into a complete program.
  • 16. 1.Write an algorithm for roots of a Quadratic Equation?  // Roots of a quadratic Equation  Step 1 : start  Step 2 : read a,b,c  Step 3 : if (a= 0) then step 4 else step 5  Step 4 : Write “ Given equation is a linear equation “  Step 5 : d=(b * b) _ (4 *a *c)  Step 6 : if ( d>0) then step 7 else step8  Step 7 : Write “ Roots are real and Distinct”  Step 8: if(d=0) then step 9 else step 10  Step 9: Write “Roots are real and equal”  Step 10: Write “ Roots are Imaginary”  Step 11: stop
  • 17. 2. Write an algorithm to find the largest among three different numbers entered by user  Step 1: Start  Step 2: Declare variables a,b and c.  Step 3: Read variables a,b and c.  Step 4: If a>b  If a>c  Display a is the largest number.  Else  Display c is the largest number.  Else  If b>c  Display b is the largest number.  Else  Display c is the greatest number.  Step 5: Stop
  • 18. Complexity of Algorithm  Algorithmic complexity is concerned about how fast or slow particular algorithm performs. We define complexity as a numerical function T(n) - time versus the input size n. Performance Analysis an Algorithm:  The Efficiency of an Algorithm can be measured by the following metrics. Time Complexity:  The amount of time required for an algorithm to complete its execution is its time complexity. An algorithm is said to be efficient if it takes the minimum (reasonable) amount of time to complete its execution.
  • 19. Complexity of Algorithm Space Complexity:  The amount of space occupied by an algorithm is known as Space Complexity. An algorithm is said to be efficient if it occupies less space and required the minimum amount of time to complete its execution.
  • 21. Example The total frequency counts of the program segments A, B and C given by 1, (3n+1) and (3n2+3n+1) respectively are expressed as O(1), O(n) and O(n2)
  • 22. Asymptotic Notations  Asymptotic notations are the mathematical notations used to describe the running time of an algorithm when the input tends towards a particular value or a limiting value.  It is often used to describe how the size of the input data affects an algorithm’s usage of computational resources.  The time required by an algorithm falls under three types Best Case − Minimum time required for program execution.  Average Case − Average time required for program execution.  Worst Case − Maximum time required for program execution.
  • 23. Asymptotic Notations  The time required by an algorithm falls under three types Best Case − Minimum time required for program execution.  Average Case − Average time required for program execution.  Worst Case − Maximum time required for program execution.
  • 24. Types of Asymptotic Notations There are mainly three asymptotic notations: 1.Big-O Notation (O-notation) 2.Omega Notation (Ω-notation) 3.Theta Notation (Θ-notation) Big-O Notation (O-notation)  Big-O notation represents the upper bound of the running time of an algorithm. It measures the worst case time complexity or the longest amount of time an algorithm can possibly take to complete.
  • 25. Asymptotic Notations  If f(n) describes the running time of an algorithm, f(n) is O(g(n)) if there exist a positive constant C and positive integer n0 such that, 0 ≤ f(n) ≤ cg(n) for all n ≥ n0
  • 26.  Example: Find upper bound of running time of constant function f(n) = 6993.  To find the upper bound of f(n), we have to find c and n0 such that 0 ≤ f (n) ≤ c.g(n) for all n ≥ n0  0 ≤ f (n) ≤ c × g (n)  0 ≤ 6993 ≤ c × g (n)  0 ≤ 6993 ≤ 6993 x 1  So, c = 6993 and g(n) = 1
  • 27.  Any value of c which is greater than 6993, satisfies the above inequalities, so all such values of c are possible.  0 ≤ 6993 ≤ 8000 x 1 → true  0 ≤ 6993 ≤ 10500 x 1 → true  Function f(n) is constant, so it does not depend on problem size n. So n0= 1  f(n) = O(g(n)) = O(1) for c = 6993, n0 = 1  f(n) = O(g(n)) = O(1) for c = 8000, n0 = 1 and so on.
  • 28.  Example: Find upper bound of running time of a linear function f(n) = 6n + 3.  To find upper bound of f(n), we have to find c and n0 such that 0 ≤ f (n) ≤ c × g (n) for all n ≥ n0  0 ≤ f (n) ≤ c × g (n)  0 ≤ 6n + 3 ≤ c × g (n)  0 ≤ 6n + 3 ≤ 6n + 3n, for all n ≥ 1 (There can be such infinite possibilities)  0 ≤ 6n + 3 ≤ 9n  So, c = 9 and g (n) = n, n0 = 1
  • 29.  Tabular Approach  0 ≤ 6n + 3 ≤ c × g (n)  0 ≤ 6n + 3 ≤ 7 n  Now, manually find out the proper n0, such that f (n) ≤ c.g (n) n f(n) = 6n + 3 c.g(n) = 7n 1 9 7 2 15 14 3 21 21 4 27 28 5 33 35
  • 30.  From Table, for n ≥ 3, f (n) ≤ c × g (n) holds true. So, c = 7, g(n) = n and n0 = 3, There can be such multiple pair of (c, n0)  f(n) = O(g(n)) = O(n) for c = 9, n0 = 1  f(n) = O(g(n)) = O(n) for c = 7, n0 = 3  and so on.
  • 31. Omega Notation (Ω-Notation)  Omega notation represents the lower bound of the running time of an algorithm. It measures the best case time complexity or the best amount of time an algorithm can possibly take to complete.  If f(n) describes the running time of an algorithm, The function f is said to be Ω(g), if there is a constant c > 0 and a natural number n0 such that c*g(n) ≤ f(n) for all n ≥ n0
  • 33. Example  Find lower bound of running time of constant function f(n) = 23.  To find lower bound of f(n), we have to find c and n0 such that { 0 ≤ c × g(n) ≤ f(n) for all n ≥ n0 }  0 ≤ c × g(n) ≤ f(n)  0 ≤ c × g(n) ≤ 23  0 ≤ 23.1 ≤ 23 → true  0 ≤ 12.1 ≤ 23 → true  0 ≤ 5.1 ≤ 23 → true
  • 34. Example: Find lower bound of running time of a linear function f(n) = 6n + 3.  To find lower bound of f(n), we have to find c and n0 such that 0 ≤ c.g(n) ≤ f(n) for all n ≥ n0  0 ≤ c × g(n) ≤ f(n)  0 ≤ c × g(n) ≤ 6n + 3  0 ≤ 6n ≤ 6n + 3 → true, for all n ≥ n0  0 ≤ 5n ≤ 6n + 3 → true, for all n ≥ n0  Above both inequalities are true and there exists such infinite inequalities. So,  f(n) = Ω (g(n)) = Ω (n) for c = 6, n0 = 1  f(n) = Ω (g(n)) = Ω (n) for c = 5, n0 = 1  and so on.
  • 35. Theta Notation (Θ-Notation)  Theta notation represents the represents the upper and the lower bound of the running time of an algorithm, it is used for analyzing the average-case complexity of an algorithm.  The function f is said to be Θ(g), if there are constants c1, c2 > 0 and a natural number n0 such that c1* g(n) ≤ f(n) ≤ c2 * g(n) for all n ≥ n0
  • 36.  Theta Notation (Θ-Notation)
  • 37.  Find tight bound of running time of constant function f(n) = 23.  To find tight bound of f(n), we have to find c1, c2 and n0 such that, 0 ≤ c1× g(n) ≤ f(n) ≤ c2 × g(n) for all n ≥ n0  0 ≤ c1× g(n) ≤ 23 ≤ c2 × g(n)  0 ≤ 22 ×1 ≤ 23 ≤ 24 × 1, → true for all n ≥ 1  0 ≤ 10 ×1 ≤ 23 ≤ 50 × 1, → true for all n ≥ 1  Above both inequalities are true and there exists such infinite inequalities.
  • 38.  So, (c1, c2) = (22, 24) and g(n) = 1, for all n ≥ 1  (c1, c2) = (10, 50) and g(n) = 1, for all n ≥ 1  f(n) = Θ (g (n)) = Θ (1) for c1 = 22, c2 = 24, n0 = 1  f(n) = Θ (g (n)) = Θ (1) for c1 = 10, c2 = 50, n0 = 1  and so on.
  • 39.  Example: Find tight bound of running time of a linear function f(n) = 6n + 3.  To find tight bound of f(n), we have to find c1, c2 and n0 such that, 0 ≤ c1× g(n) ≤ f(n) ≤ c2 × g(n) for all n ≥ n0  0 ≤ c1× g(n) ≤ 6n + 3 ≤ c2 × g(n)  0 ≤ 5n ≤ 6n + 3 ≤ 9n, for all n ≥ 1  Above inequality is true and there exists such infinite inequalities.  So, f(n) = Θ(g(n)) = Θ(n) for c1 = 5, c2 = 9, n0 = 1
  • 40. Data Structure  Data structure is a representation of data and the operations allowed on that data.  Data structure is a way to store and organize data in order to facilitate the access and modifications.  Data Structure are the method of representing of logical relationships between individual data elements related to the solution of a given problem.
  • 41. Operations on the Data Structures Following operations can be performed on the data structures:  Traversing  Searching  Inserting  Deleting  Sorting  Merging
  • 42. Operations on the Data Structures  Traversing- It is used to access each data item exactly once so that it can be processed.  Searching- It is used to find out the location of the data item if it exists in the given collection of data items.  Inserting- It is used to add a new data item in the given collection of data items.  Deleting- It is used to delete an existing data item from the given collection of data items.  Sorting- It is used to arrange the data items in some order i.e. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.  Merging- It is used to combine the data items of two sorted files into single file in the sorted form.
  • 43. Application of Data Structures The following are some of the most important areas where data structures are used:  Artificial intelligence  Compiler design  Machine learning  Database design and management  Blockchain  Numerical and Statistical analysis  Operating system development  Image & Speech Processing  Cryptography
  • 46. Selection of Data Structure  The choice of particular data model depends on two consideration:  It must be rich enough in structure to represent the relationship between data elements  The structure should be simple enough that one can effectively process the data when necessary
  • 47. Types of Data Structure  Linear: In Linear data structure, values are arrange in linear fashion.  Array: Fixed-size  Linked-list: Variable-size  Stack: Add to top and remove from top  Queue: Add to back and remove from front  Priority queue: Add anywhere, remove the highest priority
  • 48. Types of Data Structure  Non-Linear: The data values in this structure are not arranged in order.  Hash tables: Unordered lists which use a ‘hash function’ to insert and search  Tree: Data is organized in branches.  Graph: A more general branching structure, with less strict connection conditions than for a tree
  • 49. Type of Data Structures  Homogenous: In this type of data structures, values of the same types of data are stored.  Array  Non-Homogenous: In this type of data structures, data values of different types are grouped and stored.  Structures  Classes
  • 50. Abstract Data Type and Data Structure  Definition:-  Abstract Data Types (ADTs) stores data and allow various operations on the data to access and change it.  A mathematical model, together with various operations defined on the model  An ADT is a collection of data and associated operations for manipulating that data  Data Structures  Physical implementation of an ADT  data structures used in implementations are provided in a language (primitive or built-in) or are built from the language constructs (user-defined)  Each operation associated with the ADT is implemented by one or more subroutines in the implementation
  • 51. Abstract Data Type(ADT)  ADTs support abstraction, encapsulation, and information hiding.  Abstraction is the structuring of a problem into well- defined entities by defining their data and operations.  The principle of hiding the used data structure and to only provide a well-defined interface is known as encapsulation.
  • 52. The Core Operations of ADT  Every Collection ADT should provide a way to:  add an item  remove an item  find, retrieve, or access an item  Many, many more possibilities  is the collection empty  make the collection empty  give me a sub set of the collection
  • 53. The Core Operations of ADT • No single data structure works well for all purposes, and so it is important to know the strengths and limitations of several of them
  • 54. Stacks  Collection with access only to the last element inserted  Last in first out  insert/push  remove/pop  top  make empty Top Data4 Data3 Data2 Data1
  • 55. Queues  Collection with access only to the item that has been present the longest  Last in last out or first in first out  enqueue, dequeue, front  priority queues and dequeue Data4 Data3 Data2 Data1 Front Back
  • 56. List  A Flexible structure, because can grow and shrink on demand. Elements can be:  Inserted  Accessed  Deleted At any position first last
  • 57. Tree  A Tree is a collection of elements called nodes.  One of the node is distinguished as a root, along with a relation (“parenthood”) that places a hierarchical structure on the nodes. Root