GATEverse Practice, past papers & mock tests
GATE 2018
AlgorithmsDynamic ProgrammingeasyNAT2 marks
Consider items with (Weight, Value): Item 1 (10 kg, Rs 60), Item 2 (7 kg, Rs 28), Item 3 (4 kg, Rs 20), Item 4 (2 kg, Rs 24). Knapsack capacity is 11 kg (0/1 Knapsack). V_opt is the optimal value, and V_greedy is the value obtained by sorting items by value-to-weight ratio in descending order and picking greedily. The value of V_opt - V_greedy is _______
Save your progress

Related Algorithms PYQs