lec14 - n CS 323/700 Lecture 14 o Design and Analysis of...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: n CS 323/700 Lecture 14 o Design and Analysis of Algorithms Hoeteck Wee · [email protected] http://algorithms.qwriting.org/ Announcements I Homework 7 deadline extended to Apr 11 (Sun), 11.59 pm I Homeworks 8 and 9 will due Apr 26 (Mon) and May 3 (Mon) I Midterm 2 on Apr 19 (Mon) I greedy, divide-and-conquer, dynamic programming Hoeteck Wee CS 323/700 Apr 7, 2010 2 / 8 Longest common subsequence (LCS) PROBLEM. given two strings x , y , find the longest common subsequence . I C A T A C T I H I E R O G L Y P H O L O G Y M I C H A E L A N G E L O I brute force: try all subsequences of x — O ( 2 m n ) time 1ST STEP. find opt := length of longest common subsequence I break opt down into sub-problems — opt[i,j] : length of LCS of x[:i], y[:j] I opt corresponds to answer to some sub-problem — return opt[m,n] I solve sub-problems bottom-up recursively (figure out the choices ) — start with opt[0,0] , then opt[1,0] , opt[2,0] , ......
View Full Document

{[ snackBarMessage ]}

Page1 / 8

lec14 - n CS 323/700 Lecture 14 o Design and Analysis of...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online