15.Dynamic Programming
IVPL
Dynamic programming is typically
applied to optimization problems. In
such problem there can be many
solutions. Each solution has a value,
and we wish to find a solution with the
optimal value.
Chapter 15
P.2
IVPL
The developme

16.Greedy algorithms
IVPL
16.1 An activity-selection
problem
Chapter 16
Suppose we have a set S = cfw_a1, a2, ., an of n
proposed activities that with to use a
resource. Each activity ai has a start time si
and a finish time fi, where 0 si < fi < .
If sel

Backtracking and Branch-andBound
Expected Outcomes
Constrained Satisfaction Problems
Describe the ideas of backtracking
and branch and bound techniques
Solve some difficult problems by
the backtracking technique
2
Example: Map Coloring
Variables: WA, NT,

CMP3005
Design & Analysis of
Algorithms
Nafiz ARICA
Week-2
Analysis of Algorithms
Analysis of Algorithms is the area of computer
science that provides tools to analyze the efficiency of
different methods of solutions.
There are two aspects of algorithmic

CMP 3005
Analysis of Algorithms
Heap Sort
Outline
Heaps
Priority Queues
Heap sort
Priority Queues
Many applications require that we process records
with keys in order, but not necessarily in full sorted
order.
Often we collect a set of items and proces

0-1 Knapsack problem
1
Knapsack problem
Given some items, pack the knapsack to get
the maximum total value. Each item has some
weight and some value. Total weight that we can
carry is no more than some fixed number W.
So we must consider weights of items

12.Binary Search Trees
12.1 What is a binary search
tree?
Binary-search property:
Let x be a node in a binary search tree. If
y is a node in the left subtree of x, then
key[y] key[x]. If y is a node in the right
subtree of x, then key[x] key[y].
Chapter 1

Dynamic Programming
Dynamic Programming
Dynamic Programming is a general algorithm design
technique.
Invented by American mathematician Richard Bellman in
the 1950s to solve optimization problems
Main idea:
solve several smaller (overlapping) subproblems

Dynamic Programming
Dynamic Programming
Dynamic Programming is a general algorithm design
technique.
Invented by American mathematician Richard Bellman in
the 1950s to solve optimization problems
Main idea:
solve several smaller (overlapping) subproblems

BG 412
Recurrences
Math Background: Review & Beyond
1. Asymptotic notation
2. Math used in asymptotics
3. Recurrences
4. Probabilistic analysis
Recursion
When an algorithm contains a recursive call to itself,
its running time can often be described by a

CMP3005
Design & Analysis of
Algorithms
Nafiz ARICA
Course Overview
Course Schedule
Monday
14.30-17.30 D311
Tuesday
14.30-17.30 G102,
Textbooks
Cormen, T. H., Leiserson, C. E., Rivest, R. L. and
Stein, C., Introduction to Algorithms (3rd Edition),
MIT

BG 412
Asymptotic Notation
Math Background: Review & Beyond
1. Asymptotic notation
2. Math used in asymptotics
3. Recurrences
4. Probabilistic analysis
2
Asymptotes: Why?
How to describe an algorithms running time?
(or space, )
How does the running time d