Q. In the context of dynamic programming, what does the term 'state' refer to?
-
A.
The current value of a variable
-
B.
A specific configuration of the problem
-
C.
The final result
-
D.
The input size
Solution
In dynamic programming, 'state' refers to a specific configuration of the problem that can be solved using previously computed states.
Correct Answer:
B
— A specific configuration of the problem
Learn More →
Q. What is the primary difference between top-down and bottom-up dynamic programming?
-
A.
Top-down uses recursion, bottom-up uses iteration
-
B.
Bottom-up is faster
-
C.
Top-down requires more memory
-
D.
There is no difference
Solution
The primary difference is that top-down uses recursion with memoization, while bottom-up builds solutions iteratively.
Correct Answer:
A
— Top-down uses recursion, bottom-up uses iteration
Learn More →
Q. Which dynamic programming technique is used to solve the Longest Common Subsequence problem?
-
A.
Top-down
-
B.
Bottom-up
-
C.
Greedy
-
D.
Brute force
Solution
The Longest Common Subsequence problem is typically solved using the bottom-up dynamic programming technique.
Correct Answer:
B
— Bottom-up
Learn More →
Q. Which of the following is a common application of dynamic programming?
-
A.
Finding the shortest path in a graph
-
B.
Sorting an array
-
C.
Searching an element in a list
-
D.
Reversing a string
Solution
Finding the shortest path in a graph, such as using Dijkstra's algorithm, is a common application of dynamic programming.
Correct Answer:
A
— Finding the shortest path in a graph
Learn More →
Showing 1 to 4 of 4 (1 Pages)