0% found this document useful (0 votes)
69 views24 pages

Design & Analysis of Algorithm

This document outlines the objectives and topics covered in an undergraduate course on algorithm design and analysis. The main objectives are to introduce students to fundamental algorithm design techniques, evaluating and comparing the performance of different solutions to common problems. Key topics include analyzing the time and space efficiency of algorithms, classifying problems into decision, function, and search types, and describing algorithms formally using pseudocode. Performance analysis and proving the correctness of algorithms are emphasized. Common data structures and approaches to solving problems are also discussed.

Uploaded by

amta nadeem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views24 pages

Design & Analysis of Algorithm

This document outlines the objectives and topics covered in an undergraduate course on algorithm design and analysis. The main objectives are to introduce students to fundamental algorithm design techniques, evaluating and comparing the performance of different solutions to common problems. Key topics include analyzing the time and space efficiency of algorithms, classifying problems into decision, function, and search types, and describing algorithms formally using pseudocode. Performance analysis and proving the correctness of algorithms are emphasized. Common data structures and approaches to solving problems are also discussed.

Uploaded by

amta nadeem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Design & Analysis of

Algorithm
Course Objectives
 Algorithms are the core subject in
computer science when it comes to
problem solving by computers.
 The main objective of this undergraduate
level course is to introduce students to the
crux of algorithm design, evaluation and
implementation.
 Famous computer science problems will
be discussed and various approaches to
the solution would be compared.
This course
 About performance!
 Because, performance is the line between feasible
and unfeasible.
 E.g.if not fast enough, can not be adopted (fast web
search)

 This study allows us to develop a theoretical


language widely adopted by practitioners, provides a
clean way of thinking about algorithms.

 Think of performance as currency!


You need to have good/enough performance to be
able to incorporate other features/specification
Algorithm
 Well defined steps defined to solve a
problem
 A well-defined procedure that takes some
value or set as input and produces an
output.
Solving Interesting Problems

1. Design
Create data structures & algorithms to solve problems.

2. Prove algorithms work Analysis

 Buggy algorithms are worthless!

3. Examine properties of algorithms.


 Simplicity, running time, space needed, …
Three Kinds of Problems: 1

Decision problems

Given input, does it have a certain property?

 Is an integer prime?
 Is a graph planar? (Can be drawn on a plane without overlapping edges?)
Also called an instance of the problem.
Three Kinds of Problems: 2
Function problems

Given input, compute the unique solution.

 Compute the product of two matrices.


 Sort an array.
Three Kinds of Problems: 3

Search problems

Given input, compute any one of a set of solutions.

 Find the factors of an integer.


 Find shortest path between two points in graph.
 Find shortest path between each pair of points in graph.
Properties of Algorithms: 1

Time efficiency
As a function of its input size, how long does it take?

Space efficiency
As a function of its worst-
Especially, input &size, how much
average-case additional
asymptotic space does it use?
efficiency.
Properties of Algorithms: 2
Simplicity
 Informal notion
 Easier to code correctly
 Lower constant factors in time efficiency (typically)
 Easier to explain
 Easier to prove correct (probably)
 More mathematically “elegant”
Ideal algorithm?

Criteria for selecting algorithms

 1. Correctness
 2. Amount of work done
 3. Amount of space used
 4. Simplicity, clarity
 5. Optimality
(In 2001)
Another Example
Sys. A executes 1 billion instructions per second
Sys. B executes 10 million instructions per second
A uses insertion sort with 2n2 steps
B uses merge sort with 50n log(n) steps
How much time do they take when n = 1 million?

While Computer B takes


Algorithm Descriptions
 Algorithms can be described in many
forms and ways.
 High-level
natural language description
 Formal description (CS)
 Coded form
Algorithm Descriptions
High-level natural language description
Algorithm Descriptions
Formal Representation-Pseudo code
Formal Description (Pseudo Code)
 In the book, typically written in a pseudo
code
 Very clear
 Hides low level details
 Not concerned with software engineering
issues.
Algorithm Descriptions
Coded form: C++
Computational Model
 Random-Access Machine (RAM)
 One processor
 Instructions are executed in a sequential order

Analyzing problems is a challenging task!


We need to summarize the behavior of the
algorithm in simple and understandable
formulas.
References:
 Stony Brook University:
http://www.cs.sunysb.edu/~algorith/video-lectures/
 Rice University:
https://www.clear.rice.edu/comp482
 MIT Algorithms Course:
http://ocw.mit.edu/courses/electrical-engineering-and-c
mputer-science/6-006-introduction-to-algorithms-fall-20
1
/
Coursera Online Courses
 Last Years Course https://
www.coursera.org/course/algo
 Princeton University part 1 and part 2

https://www.coursera.org/course/algs4partI
https://www.coursera.org/course/algs4partII
 Stanford University

https://www.coursera.org/course/algo

You might also like