6 Lecture
CS502
Midterm & Final Term Short Notes
Dynamic Programming
Dynamic Programming is a problem-solving technique used to solve complex optimization problems by breaking them down into smaller, simpler subproblems and solving them recursively. It involves solving each subproblem only once and storing the re
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
- Which of the following is not a characteristic of Dynamic Programming?
A. It is a top-down approach
B. It is based on recursion
C. It involves solving subproblems only once
D. It is a brute force technique
Answer: D
Which of the following is the main goal of Dynamic Programming?
A. To solve complex optimization problems
B. To solve linear equations
C. To simplify algorithms
D. To generate random numbers
Answer: A
Which of the following is an example of a problem that can be solved using Dynamic Programming?
A. Sorting an array of integers
B. Finding the shortest path in a graph
C. Calculating the factorial of a number
D. Generating random strings
Answer: B
What is the time complexity of Dynamic Programming?
A. O(n)
B. O(n log n)
C. O(n^2)
D. It depends on the problem being solved
Answer: D
Which of the following is a common technique used in Dynamic Programming?
A. Binary search
B. Bubble sort
C. Memoization
D. Quick sort
Answer: C
Which of the following is a disadvantage of using Dynamic Programming?
A. It can be time-consuming
B. It requires advanced mathematical knowledge
C. It can lead to memory overflow
D. It cannot be used for optimization problems
Answer: C
What is the difference between memoization and tabulation in Dynamic Programming?
A. Memoization involves storing solutions in a table, while tabulation involves solving subproblems recursively.
B. Memoization involves solving subproblems recursively, while tabulation involves storing solutions in a table.
C. Memoization and tabulation are the same thing.
D. Memoization is only used for top-down approaches, while tabulation is only used for bottom-up approaches.
Answer: B
Which of the following is an example of a problem that can be solved using both recursive and iterative approaches?
A. Finding the nth Fibonacci number
B. Calculating the sum of an array of integers
C. Sorting an array of integers
D. Generating random numbers
Answer: A
Which of the following is not a step involved in solving a problem using Dynamic Programming?
A. Breaking down the problem into smaller subproblems
B. Storing the solutions of each subproblem in a table
C. Solving the subproblems in a random order
D. Combining the solutions of each subproblem to solve the original problem
Answer: C
Which of the following is a common optimization technique used in Dynamic Programming?
A. Greedy algorithm
B. Divide and conquer
C. Backtracking
D. Branch and bound
Answer: A
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
What is Dynamic Programming? Answer: Dynamic Programming is a problem-solving technique used to solve complex optimization problems by breaking them down into smaller, simpler subproblems and solving them recursively. What are the two approaches to Dynamic Programming? Answer: The two approaches to Dynamic Programming are top-down (memoization) and bottom-up (tabulation). What is memoization in Dynamic Programming? Answer: Memoization is an approach in Dynamic Programming where solutions to subproblems are stored in a table, which can be accessed later to solve larger subproblems. What is tabulation in Dynamic Programming? Answer: Tabulation is an approach in Dynamic Programming where solutions to subproblems are computed iteratively and stored in a table, which can be used to solve larger subproblems. What is the difference between memoization and tabulation in Dynamic Programming? Answer: Memoization involves solving subproblems recursively and storing the solutions in a table, while tabulation involves computing the solutions iteratively and storing them in a table. What are the advantages of using Dynamic Programming? Answer: The advantages of using Dynamic Programming include improved efficiency, reduced computational resources, and the ability to solve complex optimization problems. What is the principle of optimality in Dynamic Programming? Answer: The principle of optimality in Dynamic Programming states that an optimal solution to a problem can be obtained by combining optimal solutions to its subproblems. What is the time complexity of Dynamic Programming? Answer: The time complexity of Dynamic Programming depends on the problem being solved and the approach used. What are the common applications of Dynamic Programming? Answer: The common applications of Dynamic Programming include robotics, operations research, computer science, economics, and finance. What are the limitations of using Dynamic Programming? Answer: The limitations of using Dynamic Programming include high memory requirements, difficulty in solving some problems, and the need for mathematical knowledge.