Fractional Knapsack Problem Multiple choice Questions and Answers (MCQs)
Click on any option to know the CORRECT ANSWERS
Fractional knapsack problem is also known as .....
0/1 knapsack problem
Continuous knapsack problem
Divisible knapsack problem
Non continuous knapsack problem
Question 1 Explanation:
Fractional knapsack problem is also called continuous knapsack problem. Fractional knapsack is solved using dynamic programming.
Fractional knapsack problem is solved most efficiently by which of the following algorithm?
Divide and conquer
Question 2 Explanation:
Greedy algorithm is used to solve this problem. We first sort items according to their value/weight ratio and then add item with highest ratio until we cannot add the next item as a whole. At the end, we add the next item as much as we can.
What is the objective of the knapsack problem?
To get maximum total value in the knapsack
To get minimum total value in the knapsack
To get maximum weight in the knapsack
To get minimum weight in the knapsack
Question 3 Explanation:
The objective is to fill the knapsack of some given volume with different materials such that the value of selected items is maximized.
Which of the following statement about 0/1 knapsack and fractional knapsack problem is correct?
In 0/1 knapsack problem items are divisible and in fractional knapsack items are indivisible
Both are the same
0/1 knapsack is solved using a greedy algorithm and fractional knapsack is solved using dynamic programming
In 0/1 knapsack problem items are indivisible and in fractional knapsack items are divisible
Question 4 Explanation:
In fractional knapsack problem we can partially include an item into the knapsack whereas in 0/1 knapsack we have to either include or exclude the item wholly.
Time complexity of fractional knapsack problem is .....
O(n log n)
Question 5 Explanation:
As the main time taking a step is of sorting so it defines the time complexity of our code. So the time complexity will be O(n log n) if we use quick sort for sorting.
There are 5 questions to complete.