DSA Lab 9 Fall 2009, 10/29/09
This lab is about Dynamic Programming
- 6.1 (DG) - Implement your algorithm, (Hint: You may want to have variables runningsum and bestmax. If
runningsum > bestmax then replace bestmax by running sum. if running sum is < 0
then you may want to reset runningsum to zero. Increase the index of the array). Outputting the contiguous subsequence is optional.)
- 6.2 (DG) Your instructor has written a code
Lab9-2.cc and Sample Data2. Your job is to modify the code, if the cost of staying at a hotel is 1000 units (same units as the earlier objective function).