Q. In dynamic programming, what is the term for breaking a problem into smaller subproblems?
-
A.
Memoization
-
B.
Recursion
-
C.
Optimal substructure
-
D.
Overlapping subproblems
Solution
Optimal substructure refers to the property that a problem can be broken down into smaller, simpler subproblems.
Correct Answer:
C
— Optimal substructure
Learn More →
Q. What is memoization in the context of dynamic programming?
-
A.
A technique to sort data
-
B.
A method to store intermediate results
-
C.
A way to optimize space complexity
-
D.
A type of data structure
Solution
Memoization is a technique used in dynamic programming to store intermediate results to avoid redundant calculations.
Correct Answer:
B
— A method to store intermediate results
Learn More →
Q. Which of the following algorithms uses dynamic programming to find the minimum edit distance between two strings?
-
A.
Dijkstra's algorithm
-
B.
Floyd-Warshall algorithm
-
C.
Levenshtein distance algorithm
-
D.
Merge sort algorithm
Solution
The Levenshtein distance algorithm uses dynamic programming to compute the minimum edit distance between two strings.
Correct Answer:
C
— Levenshtein distance algorithm
Learn More →
Showing 1 to 3 of 3 (1 Pages)