CISC 365 Lecture Notes - Lecture 13: American Broadcasting Company, Substring, Subsequence

33 views7 pages

Document Summary

Review of the dynamic programming solution for subset sum. Let s = { } and let the target value be k. Suppose there is a subset s* of s that sums to k. let be the nal element of s*. Then the rest of s* is a solution to the subset sum problem on { } with target value k - . (this is the. Principle of optimality at work we discuss this in more detail below. ) We can look at the process of nding a solution as a sequence of decisions: rst we decide whether or not to include , then , etc. This suggests constructing a table s_s in which we list the elements of s on one axis, and possible target values x on the other. For the x values, we will use 1 k. then s_s(i,x) = true i { } contains a subset that sums to x.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions