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

Lecture 1

Uploaded by

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

Lecture 1

Uploaded by

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

Design and

Analysis of
Algorithm
Lecture 1: Introduction

Dr. Tauheed
Contents
General information

Course weightage

Course content

Introduction to Algorithm

2
Regarding Course
• Course Assignment and Lab Submissions: Mahindra Euclid
• Keeping the class strength in mind, you are encouraged to contact via email as it may
not be feasible to meet in person most of the time.
• It is mandatory to attend all the exams and submit the assignments on time.
• Missing Minor exams will not be given re-test. If a student misses it due to genuine and
verifiable reason(s), she/he will be given weightage for the missed exam(s) on a pro-rate
basis of performance in the end-sem exam.
• In a supplementary no grade better than grade “D” can be obtained.
Course Outcomes
After successful completion of the course, students will be able to:

• CO1: Apply the concepts of asymptotic notations in analyzing algorithm efficiency.


• CO2: Apply and analyze major algorithms and data structures.
• CO3: Solve problems using algorithm design methods such as the greedy method, divide and conquer, and
dynamic programming.
• CO4: Develop strategies to address computationally challenging problems through approximation algorithms.

4
Course Content
Introduction, Characteristics of algorithms, asymptotic notation: big-oh, theta, big-omega, little-oh and
little-omega, time complexity and space complexity, recurrence relations, ways to Solve Recurrence
Relations: substitution, iterative, recurrence tree, master method, Divide and Conquer: Merge sort, Quick
sort, Selection sort, convex hulls.

Greedy: Greedy choice, optimal substructure property, Job Sequencing with deadline, fractional Knapsack,
Single source shortest path.

Dynamic Programming: Multistage graph, Assembly line Scheduling, Reliability Design, all pair shortest
path, 0-1 Knapsack, Optimal Binary search Tree, Travelling Salesman Problem.

Backtracking: Graph coloring, sum of subsets, N-Queen Problem.


5
Course Content
Graph Traversal Techniques: Representation of graphs, BFS, DFS, connected components, topological
sorting of DAGS, biconnected components and strongly connected components in directed graphs, Max
flow-min cut.

The naive string-matching algorithm, The Rabin-Karp algorithm, Boyer Moore algorithm, The Knuth-
Morris-Pratt algorithm.

Classes P and NP, reduction, NP-completeness, examples of NP-complete problems, Approximation


algorithms, Randomized algorithms.

6
Text Books

 Introduction to Algorithms, 4TH Edition, Thomas H Cormen, Charles E Lieserson,


Ronald L Rivest and Clifford Stein, MIT Press/McGraw-Hill.
 Algorithms, by Dasgupta, Papadimitrou and Vazirani, McGraw-Hill Education, 2006.
 Computer Algorithms, by Horowitz, Sahni, and Rajasekaran, Silicon Press, 2007.
 Algorithm Design, by Kleinberg and Tardos, Pearson, 2005.

7
Course Weightage

Evaluation Parameter Weightage

Minor I 20%

Minor II 20%

End Sem 40%

Lab + Assignment 20%


What is an Algorithm?
An algorithm is “A finite set of precise instructions for performing a computation or for
solving a problem”.
Algorithm Characteristics
All algorithms must satisfy the following criteria:

There are zero or more quantities that are externally


Input supplied.
Output At least one quantity is produced.

Finiteness The algorithm terminates after a finite number of steps.

Definiteness Each instruction is clear and unambiguous

Effectiveness Every instruction must be basic enough to be carried


out.
Algorithm Specification
We can depict an algorithm in many ways.

Natural language Flow charts Pseudo code

Graphic No particularity
Implement a
representations regarding syntax
natural language
denoted programming
like English
flowcharts language.
Example 1: Natural language

• Line up the numbers vertically along matching place values.


• Add numbers along the shared place value columns.
• Write the sum of each place value below each place value column.
• If the place value column sums over nine, carry the tens digit over to the next
column to the left.
• Once all place value columns have been added, the addition is complete and
the algorithm terminates.
Example 2: Flow charts
Example 3: Pseudo code
INPUT number
SET factorial := 1, i := 1
WHILE i <= number DO
COMPUTE factorial := factorial * i
INCREASE i by 1
END LOOP
PRINT factorial
Steps to design an algorithm
• Problem definition
• Constraint to be satisfied
• Approach to design algorithm
• Divide and conquer
• Greedy
• Dynamic
• Backtracking
• Branch and Bound
• Draw flow chart
• Verification
• Implementation
• Analysis
Algorithm Analysis
Algorithm analysis is the theoretical study of computer program performance and
resource usage.

Resources such as memory, Most often it is computational time


communication bandwidth, or (time complexity) that we want to
computer hardware are of primary measure.
concern.
Algorithm Analysis
In programming what is more important than performance?

Correctness

User Robustnes
friendliness s

Scalabilit Maintainabilit
y y

Functionality
Why study DAA ?

Algorithms give you a language that is talking about program behaviour.

Performance has the capability to distinguish between what is feasible and what
is not.
e.g. Real time

You might also like