Lecture 8

# Introduction to Algorithms, Second Edition

This preview shows pages 1–2. Sign up to view the full content.

The University of Texas at Austin Lecture 8 Department of Computer Sciences Professor Vijaya Ramachandran Dynamic Programming CS357: ALGORITHMS, Spring 2006 1 Dynamic Programming In this lecture we will study an algorithmic technique called ‘dynamic programming’. Dynamic programming and the greedy strategy that we will study later solve ‘optimization’ problems. An optimization problem is one for which an input has a collection of feasible solutions, each with an associated cost, and we need to find a feasible solution that optimizes the cost; here ‘optimizes’ would mean either minimizes or maximizes , depending on the nature of the problem. Such a solution is called an optimal solution. We will now study a dynamic programming algorithm for the Longest Common Subsequence (LCS) problem. 1.1 Longest Common Subsequence Problem A sequence Z = < z 1 , · · · , z k > is a subsequence of another sequence X = < x 1 , · · · , x m > if there exists a strictly increasing sequence of indices 1 i 1 < i 2 · · · < i k m such that x i j = z j , 1 j k .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern