final - MIT OpenCourseWare http:/ocw.mit.edu 6.006...

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

View Full Document Right Arrow Icon
MIT OpenCourseWare http://ocw.mit.edu 6.006 Introduction to Algorithms Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .
Background image of page 1

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

View Full DocumentRight Arrow Icon
Introduction to Algorithms: 6.006 Massachusetts Institute of Technology May 9, 2008 Professors Srini Devadas and Erik Demaine Handout 13 Final Practice Problems 1 Subset Sum You are given a sequence of n numbers (positive or negative): x 1 , x 2 , . . . , x n Your job is to select a subset of these numbers of maximum total sum, subject to the constraint that± you can’t select two elements that are adjacent (that is, if you pick x i then you cannot pick either± x i 1 or x i +1 ).± Explain how you can find, in time polynomial in n, the subset of maximum total sum.±
Background image of page 2
2 Handout 13: Final Practice Problems 2 Collecting Coins You are given an n -by- n grid, where each square ( i, j ) contains c ( i, j ) gold coins. Assume that c ( i, j ) 0 for all squares. You must start in the upper-left corner and end in the lower-right corner,
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

final - MIT OpenCourseWare http:/ocw.mit.edu 6.006...

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