18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Lecture 12 - introduction to dynamic programming<br />

In designing algorithms for optimization problem - we must prove that the algorithm in fact gives the<br />

best possible solution.<br />

Greedy algorithms, which makes the best local decision at each step, occasionally produce a global<br />

optimum - but you need a proof!<br />

Dynamic Programming<br />

Dynamic Programming is a technique for computing recurrence relations efficiently by sorting partial<br />

results.<br />

Listen To Part 12-9<br />

Computing Fibonacci Numbers<br />

Implementing it as a recursive procedure is easy but slow!<br />

We keep calculating the same value over and over!<br />

How slow is slow?<br />

Thus , and since our recursion tree has 0 and 1 as leaves, means we have calls!<br />

file:///E|/LEC/LECTUR16/NODE12.HTM (2 of 9) [19/1/2003 1:34:58]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!