02 DSA PPT Introduction To Algorithms
02 DSA PPT Introduction To Algorithms
Introduction to Algorithms
Concepts
a) Introduction to Algorithms
i) Characteristics of Algorithm
b) Time and Space Complexity
c) Importance of efficient algorithms
i) Priori Analysis
ii) Posterior Analysis
3
Questions for this session
problem statement?
4
How do you design
the solution to a
problem statement?
5
Algorithm
6
Choose the Correct Option: Algorithm (1 min)
The method which uses well-defined instructions to complete a task from a given initial state
to end state is called ……………………….
A. Program
B. Flowchart
C. Algorithm
D. Both A and C
7
Characteristics of an Algorithm
8
How can we analyse the
performance of the
solution designed for a
problem statement?
9
Algorithmic Complexity
● Refers to the amount of processing time and memory space required for execution.
○ Time Complexity
○ Space Complexity
10
Difference Between Time and Space Complexity
11
Importance of efficient algorithms
12
InClass Activity: Design an Algorithm for Fibonacci Series
Question:
13
Solution: Design an Algorithm for Fibonacci Series
Algorithm Generate_Fibonacci (a, b, n)
Step 1- Start
Step 2- Declare variables a, b, res, n and i
Step 3- Set a=0, b=1 and i=1
Step 4- Display values of a and b
Step 5- while (i<=n) repeat Steps 6 and 10
Step 6- Compute res= a+b
Step 7- Set a=b
Step 8- Set b=res
Step 9- Display res
Step 10- Set i++
Step 11- Exit
14
Learning Outcomes
In this session, you have learnt to:
1. Students will learn about algorithms used for solving a given problem statement
3. Explain the concepts of time complexity which quantifies the amount of time taken for executing
an algorithm
4. Summarize the basics of space complexity which quantifies the amount of memory taken by an
algorithm during its execution
5. Design and develop algorithm(s) representing solutions to real-world problems and applications
● Introduction to Algorithms
15
Q&A
If you have more questions, please post them in the community on the platform.
16
What Next?
17