# Data Structures - Algorithms

11:
Which of the following algorithms solves the all-pair shortest path problem?

 A. Dijkstra's algorithm B. Floyd's algorithm C. Prim's algorithm D. Warshall's algorithm Answer Report Discuss Option: B Explanation : Dijkstra's algorithm solves single source shortest path problem. Warshall's algorithm finds transitive closure of a given graph. Prim's algorithm constructs a minimum cost spanning tree for a given weighted graph. Click on Discuss to view users comments. Write your comments here:
12:
For merging two sorted lists of sizes m and n into a sorted list of size m + n, we require comparisons of

 A. O(m) B. O(n) C. O(m+n) D. O(log(m) + log(n)) Answer Report Discuss Option: C Explanation : Each comparison will append one item to the existing merge list. In the worst case one needs m + n - 1 comparisons which is of order m+n. Click on Discuss to view users comments. Write your comments here:
13:   Unrestricted use of goto is harmful, because it
 A. makes debugging difficult. B. increases the running time of programs C. increases memory requirement of programs D. results in the compiler generating longer machine code Answer Report Discuss Option: A Explanation : Click on Discuss to view users comments. Write your comments here:
14:

Which of the following algorithm design technique is used in the quick sort algorithm?

 A. Dynamic programming B. Backtracking C. Divide and conquer D. Greedy method Answer Report Discuss Option: C Explanation : Click on Discuss to view users comments. Write your comments here:
15:

Which one of the following statements is false?