You are on page 1of 9

Algorithm Design & Analysis

(CSC206)

By

Prasanta K. Jana, IEEE Senior Member

Department of Computer Science and Engineering


Indian Institute of Technology (ISM), Dhanbad
E-mail: prasantajana@iitism.ac.in
Text Book:
Horowitz, Sahni and Rajasekaran, Fundamentals of Computer Algorithms, Galgotia.
Cormen, Leiserson and Rivest, An Intro. To Algorithms, PHI

Course Syllabus:
 History
The Word Algorithm comes from the name of Persian author:
Abu Jaf’ar Md. Ibn Musa Al Khowarizmi (c. 825 AD)

 Why to learn this subject?


 What is an Algorithm?

 How to Device/Design an Algorithm

 How to Validate
 How to Analyze
With basic operations:

Comment: Difficult

Counting Method:

Algorithm for summing n array elements:


Algorithm for Recursive Sum:
Algorithm for Summing to mxn arrays
Total Step Count: 2mn + 2m +1
Cases:
m >> n
n >> m

Frequency Count Method:


An Algorithm of summing array elements:
Example:

Proof: 3n + 2 <= 5n for all n>=1

Note: 3n +2 = O(n2) because 3n + 2 <= 3n2 for all n>=2.

We write:

O(1) < O(log n) < O(n) < O(n log n) < O(n2) < O(n3) < O(2n)
Note that

Small oh (o) and Small omega (ω):

You might also like