Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 1 7 . [ Dynamic Programming 2 ] ( 1 6 points ) Suppose you are running a bus tour company with a double
Dynamic Programming points
Suppose you are running a bus tour company with a doubledecker bus. The upper deck has seats and the lower deck has seats. There are groups of people dots, where is the number of people in the group i and is how much the group will pay to take the tour. If you decide to take a group then they all must fit on the upper deck or the lower deck, you cannot split up the group. You only have a limited number of seats so you may not be able to accommodate all groups so you wish to find a subset of the groups that you can fit on the tour that maximizes to the total value.
Design a DP algorithm that returns the maximum total value.
Step : Description of subproblems
Let be the maximum value you can achieve considering groups dots, such that that bus has i available seats in the upper deck and available seats in the lower deck.
Step : Base Cases points
Step : Recursion with justification or case analysis points
Step : ordering point
Step : form of output point
Step : runtime analysis points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started