Analysis and Design of
Algorithms
MEMBERS:
PARMAR AJAY M
ER NO:2301031000048
PARMAR SAHIL S
EN NO:2301031000053
DESAI SPARSH
EN NO:2301031000016
9/15/2025 1
INTRODUCTION TO ALGORITHMS
Definition of an Algorithm
A step-by-step procedure or formula for solving a problem.
The word "algorithm" comes from the name of the Persian mathematician, Al-Khwarizmi.
Algorithms are the foundation of computer programming and problem-solving in
computer science.
9/15/2025 2
CHARACTERISTICS OF AN ALGORITHM
• Finiteness: The algorithm must have a finite number of steps. It must terminate after a certain
number of steps.
• Definiteness: Each step of the algorithm must be precisely defined. There should be no ambiguity in
the instructions.
• Input: The algorithm should accept inputs, which could be zero or more.
• Output: It should produce at least one output that solves the problem.
• Effectiveness: The operations in the algorithm should be basic enough to be performed, in principle,
by a human using pen and paper.
9/15/2025 3
PROPERTIES OF A GOOD ALGORITHM
• Correctness: The algorithm should solve the problem it was designed for. It should provide the
correct output for all possible inputs.
• Efficiency:
• Time complexity: How fast an algorithm runs.
• Space complexity: How much memory an algorithm uses.
• Simplicity: The simpler the algorithm, the easier it is to understand, implement, and maintain.
• Scalability: The algorithm should handle larger inputs gracefully.
• Generality: The algorithm should solve a wide range of instances of the problem, not just one
specific case.
9/15/2025 4
ALGORITHM SPECIFICATION
• High-Level Description: Write the algorithm in plain language or flowcharts to give a clear
understanding before actual implementation.
• Formal Description: Writing the algorithm in formal language or pseudocode.
• Stepwise Refinement: Breaking down a complex problem into simpler sub-problems, making it
easier to design and implement the algorithm.
.
9/15/2025 5
PSEUDOCODE
• Definition: A simple, structured way of representing algorithms using human-readable language.
• Purpose: Helps bridge the gap between plain English and actual code, making it easier to understand
the algorithm’s logic.
• Example: Demonstrate a simple algorithm using pseudocode, e.g., sorting or searching.
.
9/15/2025 6
EXAMPLE:
• Demonstrate a simple algorithm using pseudocode, e.g., sorting or searching.
• Algorithm: BubbleSort
• Input: A list of numbers
• Output: A sorted list of numbers
•
• Procedure BubbleSort(list):
• n = length of list
• for i = 0 to n-1:
• for j = 0 to n-i-1:
• if list[j] > list[j+1]:
• swap list[j] and list[j+1]
.
9/15/2025 7
REAL-WORLD EXAMPLES
• Example 1: Sorting algorithms (Bubble Sort, Merge Sort)
• Example 2: Searching algorithms (Linear Search, Binary Search)
• Example 3: Pathfinding algorithms (A* Algorithm, Dijkstra’s Algorithm)
• Example 4: Algorithms in AI (Decision Trees, Neural Networks)
9/15/2025 8
COMMON TYPES OF ALGORITHMS
• Sorting Algorithms: e.g., QuickSort, MergeSort
• Search Algorithms: e.g., Binary Search, Linear Search
• Graph Algorithms: e.g., Dijkstra’s, A*
• Dynamic Programming Algorithms: e.g., Fibonacci, Knapsack Problem
.
9/15/2025 9
CONCLUSION
• Summarize the importance of understanding algorithms in problem-solving and software
development.
• Mention how algorithms are at the core of everything, from simple apps to complex
systems.
• Encourage the audience to experiment with writing pseudocode and implementing
algorithms.
9/15/2025 10