Design and Analysis of Algorithms MCQs with Answers
Practice important Design and Analysis of Algorithms MCQs with answers and explanations.
Multiple Choice Questions
Q181: What would be the maximum value obtainable with a weight limit of W = 11 using the items listed?
- A: 22
- B: 28
- C: 40
- D: 18
View Answer
C
Q182: If the weight of an item exceeds the current capacity of the knapsack, what happens?
- A: The item can be included anyway
- B: The item cannot be included
- C: The item is halved
- D: The item is removed from consideration
View Answer
B
Q183: How many items are there in the provided example of the 0/1 Knapsack Problem?
- A: 5
- B: 4
- C: 3
- D: 6
View Answer
A
Q184: Fill in the blank: The maximum capacity of the knapsack is denoted by _____.
- A: W
- B: The total weight
- C: Total value
- D: Number of items
View Answer
A
Q185: The dynamic programming approach computes the optimal solution in a ____ fashion.
- A: Top-down
- B: Bottom-up
- C: Recursive
- D: Iterative
View Answer
B
Q186: If the first four items of the example are chosen, what is the total weight?
- A: 14
- B: 20
- C: 26
- D: 10
View Answer
A
Q187: Which of the following is a characteristic of the 0/1 Knapsack Problem?
- A: Partial item selection allowed
- B: Multiple selections allowed
- C: Each item can be included once or not at all
- D: Items can be duplicated
View Answer
C
Q188: What is the result when using an auxiliary boolean array keep[i, j]?
- A: It shows which items are included in the optimal solution.
- B: It calculates the weight of the knapsack.
- C: It indicates the maximum value.
- D: It counts the number of items included.
View Answer
A
Q189: If the knapsack has a weight limit of W and the first n items are considered, what is the state of V[n, W]?
- A: The maximum value of the first n items that can fit into the knapsack.
- B: The weight of the items.
- C: The total number of items.
- D: The maximum weight of items.
View Answer
A
Q190: What is the main goal of an optimization problem?
- A: To find any solution
- B: To find the best solution
- C: To minimize time only
- D: To maximize complexity
View Answer
B