0% found this document useful (0 votes)
3 views

2_Introduction to Algorithms

The document provides an introduction to algorithms, defining them as procedures for solving mathematical problems through a finite set of instructions. It discusses applications in various fields such as computer science, mathematics, and data science, along with characteristics, design, and analysis methods. Additionally, it covers complexity analysis, highlighting time and space factors that affect algorithm efficiency, and lists advantages and disadvantages of using algorithms.

Uploaded by

princelal7890
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

2_Introduction to Algorithms

The document provides an introduction to algorithms, defining them as procedures for solving mathematical problems through a finite set of instructions. It discusses applications in various fields such as computer science, mathematics, and data science, along with characteristics, design, and analysis methods. Additionally, it covers complexity analysis, highlighting time and space factors that affect algorithm efficiency, and lists advantages and disadvantages of using algorithms.

Uploaded by

princelal7890
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Introduction to Algorithms

MD. MUKTAR HOSSAIN


LECTURER
DEPT. OF CSE
VARENDRA UNIVERSITY
Definition
A procedure for solving a mathematical problem in a finite number of steps.

An algorithm is a set of instructions that are followed to complete a task or solve a problem.

An algorithm is a set of defined steps designed to perform a specific objective.

Set of rules to
obtain expected
Input Output
output from
given input
Applications

Computer Science: Computer programming, Artificial intelligence and Machine learning etc.

Mathematics: Optimal solution to a system of linear equations or the shortest path in a graph.

Operations Research: Transportation, Logistics, and Resource allocation.

Data Science: Analyze, Process, and Extract insights from large amounts of data in fields such as

Marketing, Finance, and Healthcare.


Characteristics

It should terminate after a finite time.


It should produce at least one output.
It should take zero or more input.
It should be deterministic means giving the same

output for the same input case.


Every step in the algorithm must be effective

i.e. every step should do some work.


Design and Analysis

Design: Focuses on creating algorithms to solve a specific problem.


◦ Understanding the Problem
◦ Choosing a Strategy
◦ Developing the Algorithm
◦ Verification

Analysis: Focuses on evaluating the performance and efficiency of an algorithm.


◦ Correctness
◦ Complexity Analysis
◦ Best/Worst/Average Case Analysis
◦ Comparative Analysis
Design and Analysis Cont’d

How to Design an Algorithm?


◦ The problem that is to be solved by this algorithm i.e. clear problem definition.
◦ The constraints of the problem must be considered while solving the problem.
◦ The input to be taken to solve the problem.
◦ The output is to be expected when the problem is solved.
◦ The solution to this problem is within the given constraints.
Design and Analysis Cont’d

How to Analyze an Algorithm?


◦ Priori Analysis: It means checking the algorithm before its implementation.
◦ Posterior Analysis: It means checking the algorithm after its implementation.
◦ Correctness
◦ Space Complexity
◦ Time Complexity
Complexity Analysis

Two factors (time and space) define the efficiency of an algorithm.

Time Complexity: Refers to the amount of time required by the algorithm to execute and get
the result.

T(P) = C + V
◦ Constant Time Part (C): Any instruction that is executed just once comes in this part.
◦ Variable Time Part (V): Any instruction that is executed more than once, say n times, comes in
this part.
Complexity Analysis Cont’d

Two factors (time and space) define the efficiency of an algorithm.

Space Complexity: Refers to the amount of memory required by the algorithm to store the
variables and get the result.

S(P) = C + V
◦ Fixed Part (C): The space that is required by the algorithm.
◦ Variable Part (V): The space that can be different based on the implementation of the algorithm.
For example, temporary variables, dynamic memory allocation, recursion stack space, etc.
Advantages vs Disadvantages

Advantages:
◦ Easy to understand
◦ Serve as a blueprint
◦ Simple to debug
◦ Not dependent on programming language

Disadvantages:
◦ Time-consuming
◦ Space and time complexity
◦ Branching and Looping statements are difficult to show in Algorithms
Thank You

You might also like