Extracted MCQs Part1
Extracted MCQs Part1
Answer: O (n)
Q2. State which sorting algorithm has not the worst-case time complexity of O(n^2)?
Q3. Select which of the following statements is true about Prim's Algorithm?
Answer: O(V^2)
Answer: Starting from the leaf nodes, select the edge with minimum weight and add it to the tree
Q8. Trace which of the following statements is true about Prim's Algorithm.
Q10. Select the name of the data structure used in Kruskal's Algorithm
Answer: Linked List
Answer: O(V^2)
Answer: Select the vertex with maximum degree and add all its incident edges to the tree
Q13. Select which of the following statements is true about Kruskal's Algorithm?
Answer: Sorting
Q16. Select the most commonly used data structure for implementing Dijkstra's Algorithm
Q17. Select the correct option, the Bellman Ford algorithm produces _______ value to return.
Answer:
Q18. Select how many solution/solutions are available for a graph having negative weight cycle
Answer:
Answer:
Q20. Indentify how many times the for loop in the Bellman Ford Algorithm gets executed?
Answer:
Q21. Trace the basic principle behind Bellman Ford Algorithm?
Answer:
Q22. Select the Floyd Warshall's Algorithm and it is used for solving ____________.
Answer:
Q23. Select, the maximum flow problem which can be solved for
Answer:
Answer:
Answer:
Answer:
Q27. Select, "a simple acyclic path between source and sink which pass through only positive
Answer:
Answer:
Q29. Identify which stage of algorithm development involves understanding the problem and its
requirements?
Q32. Select what is the purpose of identifying a suitable technique in algorithm development?
Q35. State the notation is used to analyze the running time of an algorithm as the input size
increases?
Q38. Identify, which method can be used to solve recurrence relations when the Master Theorem
cannot be applied?
Q39. Predict the time complexity of Strassen's algorithm for matrix multiplication :
Answer: O(n^4)
Q40. Indicate, which of the following is a disadvantage of Strassen's algorithm for matrix
multiplication?
Q42. Predict the time complexity of building a Huffman tree for a given set of symbols with their
frequencies?
Answer: O(n^3)
Q43. Identify the time complexity of solving the fractional knapsack problem using a greedy
algorithm?
Answer: O(n^3)
Q44. Select the time complexity of the dynamic programming algorithm for solving the matrix chain
multiplication problem?
Answer: O(n^3)
Q45. Show, what is the time complexity of the dynamic programming algorithm for finding the
Answer: O(m + n)
Q46. Identify the time complexity of the backtracking algorithm for solving the N-Queens problem?
Answer:
Q47. Identify the time complexity of the dynamic programming algorithm for solving the Travelling
Answer: O(n^n)
Q49. Select the time complexity of the backtracking algorithm for solving the Travelling Salesman
Answer: O(2^n)
Answer: A problem in which the goal is to find the largest set of edges that covers all vertices in a
graph.
Q51. Identify which of the following is a common algorithm for the set-covering problem?
Answer: A problem in which the goal is to find the largest set of edges that covers all vertices in a
graph.
Q53. Identify which of the following is a common algorithm for the vertex cover problem?
Q54. State ,in the greedy algorithm for the set-covering problem, what is the criterion for choosing
Answer: Choose the set that contains the fewest uncovered edges.
Q55. Select the approximation ratio of the greedy algorithm for the set-covering problem?
Answer: N
Q56. Identify, which of the following is true about the vertex cover problem?
Q58. State ,which of the following is an approximation algorithm for the vertex cover problem?
Q59. Calculate the runtime complexity of the greedy algorithm for the vertex cover problem?
Answer:
Q60. Choose,which of the following is true about the vertex cover problem?
Answer:
Q61. Choose ,which of the following is true about the vertex cover problem on a tree?
Answer:
Q62. Select,which of the following is true about the vertex cover problem on a bipartite graph?
Answer:
Answer:
Answer:
Answer:
Answer:
Q67. Choose which of the following is a greedy algorithm for K-center clustering?
Answer:
Q68. Select, the greedy algorithm for K-center clustering has a performance guarantee of:
Answer: 1/2
Answer: A problem in which we want to find the optimal allocation of resources among several
projects.
Q70. Select which of the following is a randomized algorithm for the hiring problem?
Answer: Select each candidate with equal probability and select the one with the lowest score.
Answer:
Q74. Predict, which of the following is a brute-force algorithm for finding the minimum cut in a
graph?
Answer: Use Prim's algorithm to find the minimum spanning tree of the graph.
Q75. Predict, which of the following is true about the performance of the randomized algorithm for
Answer:
Q76. Select which of the following is true about the class NP-hard?
Answer: The problems in NP-hard can be solved by probabilistic algorithms in polynomial time.
Answer: A problem A is reducible to problem B if both problems can be solved in exponential time.
Q81. Select which of the following is true about the size of a minimum vertex cover?
Answer: It is always greater than or equal to the number of vertices in the graph
Q82. Identify,which of the following is true about the vertex cover problem?
Q83. Select,which of the following is true about the independent set of a graph?
Q84. Examine which of the following is true about the size of a maximum independent set?
Answer: It is always greater than or equal to the number of vertices in the graph
Q85. Select which of the following is true about the independent set problem?
Answer: It is always greater than or equal to the number of vertices in the graph
Q88. Select which of the following is true about the clique problem?
Answer:
Q89. Identify which of the following algorithms is commonly used to find maximum cliques in a
graph?
Answer:
Q90. Select which of the following is true about the time complexity of finding maximum cliques in a
graph?
Answer:
Q91. Solve which of the following is a brute-force approach to finding maximum cliques in a graph?
Answer:
Q92. Choose which of the following is true about the space complexity of finding maximum cliques
in a graph?
Answer:
Q93. Solve which of the following is an optimization problem related to finding cliques in a graph?
Answer:
Answer:
Q95. Choose which of the following is true about the verification step in NP algorithms?
Answer:
Q96. State the current trend in algorithm design?
Answer: They are designed to be scalable and work well on large datasets.
Q105. Choose from the following the complexity of the recurrence relation T(n) = T(n/4) +T(n/2)+n^2
Answer: O (n)
Q106. State which sorting algorithm has the worst-case time complexity of O(n^2)?
Answer: Selection sort
Answer: O(log n)
Q109. Select which algorithm is used to solve the traveling salesman problem?
Answer: O(2^n)
Q111. Choose the option which of the following problems can be solved using brute force
Q112. Predict which algorithm is a brute force approach to find the longest common substring
Q113. Show ,which of the following is an example of brute force approach to find the maximum
subarray sum?
Q114. Predict which of the following is a disadvantage of using brute force approach?
Answer: Finding the longest path that visits every node in a graph exactly once
Q116. Identify which of the following is an example of an approximate algorithm for solving the TSP?
Q117. Which of the following is a heuristic algorithm for solving the TSP?
Q118. State which of the following statements is true for the TSP?
Q119. Choose which algorithm is used to solve the TSP exactly for small instances?
Q120. Explain the basic idea of the Divide and conquer approach?
Answer: Solving a problem by selecting the first feasible solution that is found
Q121. Predict which of the following is an example of a problem that can be solved using the Divide
Q122. Select ,what is the time complexity of the Merge sort algorithm?
Q123. Determine which of the following is not a step in the Divide and conquer approach?
Answer: Exponential
Q125. Choose which of the following algorithms uses the Divide and conquer approach to find the
Q126. Examine which of the following is a disadvantage of using the Divide and conquer approach?
Answer:
Q127. Choose which of the following is an example of a problem that cannot be solved using the
Answer:
Q128. Choose which algorithm uses the Divide and conquer approach to find the median of an
array?
Answer:
Q129. Cite how many solutions are available for a graph having negative weight cycle
Answer:
Answer:
Q131. Choose which of the following is an example of a problem that can be solved using the
Greedy approach?
Answer:
Answer:
Q133. Choose which of the following is true about the class NP-complete?
Answer:
Q134. Identify which of the following algorithms uses the Greedy approach to find the shortest path
between two nodes in a graph?
Q135. Predict which of the following is a disadvantage of using the Greedy approach?
Q136. Predict which of the following face with local maxima problem
Q137. Choose which of the following is an example of a problem that cannot be solved using the
Greedy approach?
Q138. Predict which of the following algorithms uses the Greedy approach to find the Huffman
Q139. Choose which algorithm uses the Greedy approach to find the optimal sequence of activities
to be scheduled?
Answer:
Q140. Select which of the following is an example of a problem that can be solved using both the
Answer:
Answer:
Answer: Moving two squares horizontally and one square vertically or vice versa
Q143. Identify the smallest chessboard on which a Knight's Tour is possible?
Answer: 10x10
Q144. Predict the maximum number of moves required to complete a Knight's Tour on an 8x8
chessboard?
Answer: 60
Q145. Select which of the following is a common algorithm used to solve the Knight's Tour problem?
Q146. Identify which of the following is not a heuristic used to solve the Knight's Tour problem?
Answer:
Q147. Select which of the following is a key step in solving the Knight's Tour problem using
backtracking?
Answer:
Q148. Predict the time complexity of the brute force algorithm for solving the Knight's Tour problem?
Q149. Select which of the following is a disadvantage of using the brute force algorithm for solving
Answer:
Q150. Estimate the time complexity of Strassen's algorithm for matrix multiplication : Calculate the
Answer:
Q151. int a = 0, b = 0; for (i = 0; i < N; i++) { a = a + rand(); } for (j = 0; j < M; j++) { b = b + rand(); }
Y?
Q153. Observe the time complexity of the following code: int a = 0, i = N; while (i > 0) { a += i; i /= 2;
Answer: O(log N)
Q154. Choose which of the following best describes the useful criterion for comparing the efficiency
of algorithms?
Q156. Examine it is True or False: Algorithm A and B have a worst-case running time of O(n) and
Answer: FALSE
Q157. Cite an algorithm used for finding all pair shortest paths in a graph.
Answer: Compilation
Q161. Cite the algorithm known for solving the maximum flow problem in a network.
Q164. Trace the process of cycle canceling in the Cycle Cancelling Algorithm.
Q165. Cite the algorithm commonly used for finding minimum cost flows in a network.
Answer: Compilation
Q173. Cite the algorithm used for finding the minimum cut in a flow network.
Q175. Select the correct statement about the Cycle Cancelling Algorithm.
Q176. Trace the impact of augmenting the flow in the Ford-Fulkerson Algorithm.
Q178. Identify a situation where the Floyd-Warshall Algorithm is not the most efficient choice.
Q181. Cite a scenario where the Cycle Cancelling Algorithm is commonly used.
Q184. Trace the role of the Cycle Cancelling Algorithm in solving network flow problems.
Q185. Cite an example of a problem that can be modeled using flow networks.
Q187. Trace the significance of the residual graph in the Ford-Fulkerson Algorithm.
Answer: Compilation
Q194. select ,The worst-case efficiency of solving a problem in polynomial time is?
Q195. Select the correct answer, _______ is the class of decision problems that can be solved by
Answer: Complete
Answer: O(N2
Q197. Identify the class does the Euler's circuit problem belong?
Q199. Indicate How many conditions have to be met if an NP- complete problem is polynomially
reducible?
Answer: 4
Answer: NP hard
"abcbabcbabccba".
Q203. Apply the Nave String Matching Algorithm to find all occurrences of the pattern "aba" in the
text "abababab".
Answer: Occurrences of "aba" in the text: (0, 2), (2, 1), (4, 6)
Q204. Select the primary objective of string matching algorithms from the following options?
Answer: The primary objective is to locate occurrences of a part of sub string within a text string.
Q205. Choose from the following the real life example of KMP algorithm
Answer: O(m(n-m))
Q207. Identify which of the following algorithms is used to find the maximum flow in a network with
Q208. Identify which of the following algorithms is used to find the shortest path between two
Q209. Identify which of the following algorithms is used to find the maximum matching in a general
graph
Q210. Examine which of the following algorithms is used to find the bridges in an undirected graph
Answer: Tarjan's algorithm
Q211. Identify which of the following algorithms is used to find the maximum flow in a network with
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q219. State the differences between time complexity and space complexity.
Answer:
Q221. Write the steps to sort using merge sort method: 5,3,8,1,4,6,2,7
Answer:
Answer:
Q223. Analyze the result of the recurrences which fall under the first case of Master's theorem (let
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q230. Calculate the min and max term of the following array using Divide and conquer approach
{9,6,4,7,10,14,8,11}
Answer:
Q231. Write the steps to solve the 4-queens problem by backtracking method. For each step draw
Answer:
Answer:
Q233. Explain the concept of divide & conquer algorithm with an example.
Answer:
Answer:
Q235. Analyze the steps involved for the 4-queen problem using Backtracking
Answer:
Q236. T(n) = 2T(n/2) + O(n) where n>0, T(n) = 1 where n = 0. Explain the recurrence relation using
substitution method
Answer:
Answer:
Answer:
Q240. Write down the KMP Algorithm for String Matching Problem and define the time complexity of
it.
Answer:
Answer:
Q242. Solve for the all pair of shortest path using Floyd's Algorithm
Answer:
Answer:
Q244. Compute the differences between Bellman Ford and Dijkstra algorithm?
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q260. State set-covering problem related to vertex cover?
Answer:
Answer:
Answer:
Q263. Identify the optimal parenthesization of a matrix chain product whose sequence of
dimensions is (5, 10, 3, 12, 5, 50, 6). Give an algorithm of the above procedure. Analyze its
complexity.
Answer:
Answer:
Q265. Write the general Knapsack problem. Derive its time complexity.
Answer:
Q266. Examine the optimal solution using greedy criteria for Knapsack having capacity 100 kg for
the following list of items having values and weights as shown in the table
Answer:
Q267. Items
Answer:
Q268. Value
Answer:
Q269. Weight
Answer:
Q270. Summarize What is the main objective of approximation algorithms in the context of the
set-covering problem?
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q276. List the main limitation of the Nave String Matching Algorithm.
Answer:
Q277. Explain the fundamental idea behind the Knuth-Morris-Pratt (KMP) algorithm.
Answer:
Q278. Differentiate between the Rabin-Karp Algorithm and the Nave String Matching Algorithm.
Answer:
Q279. Compare and contrast the time complexity of the Nave String Matching Algorithm and the
KMP algorithm.
Answer:
Q280. Analyze the impact of pattern length on the performance of the Rabin-Karp Algorithm.
Answer:
Q281. Evaluate the significance of preprocessing in the KMP algorithm and its effect on overall
efficiency.
Answer:
Q282. Examine the advantages and disadvantages of using the Rabin-Karp Algorithm for multiple
pattern searches
Answer:
Q283. Design a pseudocode implementation for the Nave String Matching Algorithm.
Answer:
Q284. Compare and contrast the time complexity of the Nave String Matching Algorithm and the
Rabin-Karp Algorithm.
Answer:
Q285. Explain why the Knuth-Morris-Pratt (KMP) algorithm is more efficient than the Nave String
Matching Algorithm.
Answer:
Q286. Differentiate between the Rabin-Karp Algorithm and the Nave String Matching Algorithm in
Answer:
Q287. Critically judge the impact of text length and pattern length on the performance of the Nave
Answer:
Q288. Examine the way of application of the Nave String Matching Algorithm to find all occurrences
Answer:
Q289. Describe a scenario where you would prefer to use the Rabin-Karp Algorithm over the Nave
Answer:
Q290. Write why the Nave String Matching Algorithm called "nave"?
Answer:
Q291. Explain the basic idea behind the Nave String Matching Algorithm?
Answer:
Q292. Write the difference between 0/1 Knapsack and Fractional Knapsack ?
Answer:
Answer:
Answer:
Answer:
Q296. Discuss the concept of graph traversal techniques.
Answer:
Answer:
Answer:
Answer:
Answer:
Q301. Select the appropriate algorithm for finding all pair shortest paths in a weighted graph.
Answer:
Answer:
Answer:
Answer:
Answer:
Q307. Choose the appropriate algorithm for finding the maximum flow in a network.
Answer:
Answer:
Q309. Decide between Ford-Fulkerson and Push-Relabel algorithms for finding maximum flows.
Answer:
Answer:
Q311. Define the difference between linear and binary search with example
Answer:
Q312. Define the different types of complexity of algorithms and also define the criteria on which the
Answer:
Q313. Define an algorithm with an example and state the characteristics of the Algorithm.
Answer:
Q314. Define the different stages of algorithm for solving a problem with suitable example
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q321. Explain divide and conquer method to find maximum and minimum in a given array.
Answer:
Answer:
Q323. Explain Huffman coding technique for data compression with example.
Answer:
Answer:
Q325. Explain Traveling salesman problem using Dynamic programming method A is the Starting
Node.
Answer:
Answer:
Q328. Compare Brute Force Algorithm,Greedy technique and dynamic programming method in
Answer:
Answer:
Q330. Discuss all pair shortest path using Floyd Warshall Algorithm.
Answer:
Answer:
Answer:
Answer:
Q334. Discuss the usage of maximum flow and minimum flow cost with example
Answer:
Answer:
Q336. Analyze Maximum flows and minimum cost flows with suitable problem
Answer:
Answer:
Answer:
Answer:
Answer:
Q341. Discuss Maximum clique in complexity class and also state maximum size of a clique
Answer:
Answer:
Answer:
Answer:
Q345. Analyze the difference between 3-SAT and SAT techniques in complexity classes.
Answer:
Answer:
Q347. Define Randomized Algorithm
Answer:
Q348. Evaluate the set covering problem using Greedy Approximation method
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q355. Discuss traveling salesman problem using dynamic programming is NP complete or not
Answer:
Answer:
Q357. Solve to find the minimum number ofoperations required for the following matrixchain
multiplication using dynamicprogramming and also find complexityA(10X30) * B(30X50) * C(50X10)
*D(10X90)
Answer:
Q358. Solve for the all pair of shortest path using Floyd's Algorithm and also find complexity
Answer:
Q359. Solve the following table using greedy method for fractional Knapsack having capacity 60 kg
for the following list of items having values and weights as shown in the table
Answer:
Q360. Items
Answer:
Q361. Value
Answer:
Q362. Weight
Answer:
Q363. Solve the following to compress the data using Huffman Coding The Characters are
Answer:
Q364. Define What is matroid? Illustrate any two greedy algorithm techniques
Answer:
Q365. Write an algorithm to compute maximum weight and minimal independent set.
Answer:
Q366. Illustrate prims technique with an algorithm
Answer:
Answer:
Q368. Illustrate what is the augmenting path. How it is computed with the Edmonds Blossom
Algorithm
Answer:
Answer:
Answer:
Q371. Discuss the difference between the following a)Chromatic numbers in scheduling [6M]
Answer:
Q372. Evaluate the Set-Covering problem in the context of approximation algorithms with example.
Answer:
Q373. Explain the concept of Vertex Cover in graph theory and its relevance in approximation
algorithms.
Answer:
Answer:
Q375. Summarize the K-center clustering problem and elaborate on its significance in data
Answer:
Q376. Evaluate the concept of finding the global Minimum Cut in graph theory and algorithm design.
Answer:
Q377. Discriminate the approaches used in approximation algorithms for solving the Vertex Cover
Answer:
Q378. Explain the following in detail a)Huffman coding and compression b)Travelling salesperson
problem
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q384. Explain interpolation problem in detail.
Answer:
Answer:
Answer:
Answer:
Q388. Apply the Knuth-Morris-Pratt (KMP) algorithm to find the first occurrence of the pattern "aba"
in the text "ababababab". Provide a detailed explanation of the algorithm's steps, including
Answer:
Q389. Analyze the advantages and disadvantages of using the Rabin-Karp Algorithm for multiple
pattern searches within a single text string. Discuss its efficiency, potential challenges, and factors
Answer:
Q390. Apply the Nave String Matching Algorithm to find all occurrences of the pattern "aba" in the
text "abababab". Demonstrate the steps involved, including comparisons made at each step and any
Answer:
Q391. Analyze the significance of preprocessing in the Knuth-Morris-Pratt (KMP) algorithm and its
impact on overall efficiency. Discuss how preprocessing helps reduce unnecessary comparisons
and improves the algorithm's performance.
Answer:
Q392. Apply the Knuth-Morris-Pratt (KMP) algorithm to find all occurrences of the pattern "aba" in
the text "ababababab". Illustrate the steps involved, including preprocessing and character
comparisons.
Answer:
Q393. Analyze the impact of pattern length on the performance of the Rabin-Karp Algorithm.
Discuss how longer patterns affect the efficiency of the algorithm and potential challenges
encountered.
Answer:
Q394. Apply the Nave String Matching Algorithm to find all occurrences of the pattern "aba" in the
text "ababababab". Provide a step-by-step explanation of your approach, including the comparisons
Answer:
Q395. Analyze the efficiency of the Knuth-Morris-Pratt (KMP) algorithm compared to the Nave String
Matching Algorithm when searching for a pattern in a text. Provide insights into why the KMP
Answer:
Q396. Discuss important problem types that you face during Algorithm Analysis.
Answer:
Answer:
Q398. Write an algorithm to find out maximum matching in graphs
Answer:
Q399. Write notes on augmenting path. How it is computed with Edmonds Blossom Algorithm.
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Q414. Decide which algorithm is more suitable for finding the minimum cost flow in a given network.
Answer:
Q415. Distinguish between the Ford-Fulkerson algorithm and the Push-Relabel algorithm.
Answer:
Answer:
Q417. Justify the use of the Floyd-Warshall algorithm over other algorithms for certain problems.
Answer:
Q418. Compare the computational complexity of the Ford-Fulkerson algorithm with the
Push-Relabel algorithm.
Answer:
Q419. Judge the effectiveness of the Ford-Fulkerson algorithm compared to the Push-Relabel
Answer: