Directions (Q91–95): For a knapsack problem, the profits and weights of 7 items are P = {9, 5, 2, 7, 6, 16, 9} and W = {2, 5, 6, 11, 1, 9, 3}.
What is the maximum value of items you can carry if maximum weight allowed is 25 with a fractional knapsack?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. 48.1
Explanation
With capacity 25: items 5, 1, 7, 6 give 40 at weight 15; item 2 adds 5 (weight 20, profit 45); 5/11 of item 4 adds 7 × 5/11 ≈ 3.18. Total ≈ 48.1.
More Data Structures and Algorithms questions
- If new item is added to the list, total items is 8 and capacity is 25 , then the best-case time of fractional knapsack for this case is ___…
- Which of the following statements is correct for a knapsack?
- How many different binary trees are possible with ' n ' nodes?
- Let n be a positive integer and f(n) = 0 if n = 1, and f(n) = f(⌊n/2⌋) + 1 if n > 1. What is f(25), and what does the function compute?
- Given the FFT we can have ______ time procedure for multiplying two polynomials A(x) Q and B(x) of degree bound n where input and output re…
- Circuit satisfiability problem: given a Boolean combinational circuit of AND, OR and NOT gates, is it satisfiable (is there an input for wh…