final.sample

# final.sample - Problem(20 Two character strings may have...

This preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: Problem (20%) Two character strings may have many common substrings. For example, photo- graph and tomography have several common substrings of length one, and common substrings of ph and to of length two, and ograph of length six, which is also the maximum common substring. Let X = x 1 x 2 . . . x n and Y = y 1 y 2 . . . y m be two character strings. Design a dynamic program- ming algorithm to find the maximum common substring length for X and Y . Apply your algorithm to X = photograph and Y = tomography , show detailed steps. What is the complexity of your algorithm? Problem (25%) Consider a table and three toy blocks on the table. The initial state is that blocks B and C are on the table, and block A is on top of block B (figure 1). A robot arm is used to rearrange the blocks to reach a goal state in which the three blocks are stacked with block A on top, block B in the middle, and block C on the bottom....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online