Algorithm multiple choice questions part-7

Graph MCQs :-

1. What is Dynamic Programming? a) An algorithmic paradigm that solves a complex problem by breaking it into subproblems b) A method of randomly trying different solutions until finding the correct one c) An algorithm that sorts elements in an array d) A method for finding the closest pair of points in a set of points in x-y plane

Answer: a) An algorithmic paradigm that solves a complex problem by breaking it into subproblems

1. What is the main reason for using Dynamic Programming? a) To break a problem into smaller subproblems b) To try different solutions until finding the correct one c) To sort elements in an array d) To draw a graph

Answer: a) To break a problem into smaller subproblems

1. Which property of Dynamic Programming refers to the fact that solutions of the same subproblem are needed again and again? a) Optimal Substructure b) Memoization c) Tabulation d) Overlapping Subproblems

1. Which Dynamic Programming approach starts with the main problem and breaks it down into smaller subproblems until the solution is found? a) Memoization (Top Down) b) Tabulation (Bottom Up) c) Backtracking d) None of the above

1. Which Dynamic Programming approach starts with the smallest subproblems and builds up to the solution of the main problem? a) Memoization (Top Down) b) Tabulation (Bottom Up) c) Backtracking d) None of the above

1. What is the name of the algorithm that uses Dynamic Programming to find the shortest path between two vertices in a graph? a) Dijkstra's Algorithm b) Prim's Algorithm c) Bellman-Ford Algorithm d) Kruskal's Algorithm

1. What is the name of the algorithm that uses Dynamic Programming to find the all-pairs shortest path in a graph? a) Floyd-Warshall Algorithm b) Bellman-Ford Algorithm c) Dijkstra's Algorithm d) Kruskal's Algorithm

1. What is the name of the Dynamic Programming problem that involves finding the longest increasing subsequence in an array? a) Longest Common Subsequence b) Knapsack Problem c) Longest Increasing Subsequence d) Traveling Salesman Problem

1. What is the name of the Dynamic Programming problem that involves finding the minimum cost path between two vertices in a weighted graph? a) Knapsack Problem b) Shortest Path Problem c) Longest Common Subsequence d) Traveling Salesman Problem

1. What is the name of the Dynamic Programming problem that involves finding the maximum value of items that can be put into a knapsack of capacity W? a) Longest Common Subsequence b) Knapsack Problem c) Longest Increasing Subsequence d) Shortest Path Problem

1. Which algorithm uses Dynamic Programming to solve the Knapsack Problem? a) Floyd-Warshall Algorithm b) Bellman-Ford Algorithm c) Dijkstra's Algorithm d) None of the above

Answer: d) None of the above (The Knapsack Problem has its own Dynamic Programming algorithm)

Pre  ðŸ‘ˆ                                ðŸ‘‰  Next