Professional Documents
Culture Documents
ELEE28706D AlgorithmAnalysis S3
ELEE28706D AlgorithmAnalysis S3
ELEE28706D AlgorithmAnalysis S3
Algorithm Analysis
Algorithm:
Algorithm analysis is a
field of classical study
and research involving
scientific data and
complex Mathematics.
Offered as a separate
course!
Algorithm Analysis
Algorithm:
Program:
- A program is the expression of an algorithm in a programming
language
- A set of instructions which the computer will follow to solve a
problem
Problem:
- Description of input-output relationship
Data Structure:
- An organized method of storing and retrieving data
What we need to do:
- Given a problem, design a correct and robust algorithm that solves it
- To design a good algorithm, find a amenable data structure
Algorithm Analysis
Analyzing Algorithm:
- Correctness
Does the input/output relation match algorithm requirement?
- Complexity
Basic operations involved
- Space Used
Memory used
- Simplicity
Verification and implementation
Optimality
Is it possible to do better?
Algorithm Analysis
Analysis of Algorithms:
Questions:
Answers:
- Computer being used
- Data being processed
- Algorithm being used
- ……..
Algorithm Analysis
Analysis of Algorithms:
Scientific method:
Experiments must be
reproducible
Algorithm Analysis
Analysis of Algorithms:
Observation:
Problem
size!
Algorithm Analysis
Log-log plot: Plot running time T(N) vs. input size N using log-log scale.
Algorithm Analysis
Total running time: Time for each operation x frequency for all
operations.
Example: 1- Sum
Algorithm Analysis
Example: 2 – Sum
Algorithm Analysis
Example: 3- Sum
Algorithm Analysis
Order-of-growth classifications:
The order of growth of the running time of this code is N 3
Algorithm Analysis
Order-of-growth classifications:
The set of functions
Algorithm Analysis
Asymptotic Performance:
- How does the algorithm behaves as the problem size
gets very large?
Running time
Memory storage requirements
Bandwidth/power/logic gates etc.,
Algorithm Analysis
Asymptotic Analysis:
- Worst case
Provides an upper bound on running time
An absolute guarantee
- Average case
Provides the expected running time
Very useful, but with care: what is “average”?
Random inputs
Rea-life inputs
- Best case
Algorithm Analysis
Memory: Basics
Algorithm Analysis
Example:
Acknowledgements