Top 150+ Solved Design and Analysis of Algorithms MCQ Questions Answer

From 16 to 30 of 152

Q. Which of the following takes O(n) time in worst case in array implementation of stack?

a. pop

b. push

c. isempty

d. pop, push and isempty takes constant time

  • d. pop, push and isempty takes constant time

Q. What will be the time complexity of the code to reverse stack recursively?

a. o(n)

b. o(n log n)

c. o(log n)

d. o(n2)

  • d. o(n2)

Q. Which of the following sorting algorithm has best case time complexity of O(n2)?

a. bubble sort

b. selection sort

c. insertion sort

d. stupid sort

  • b. selection sort

Q. Which of the following is the biggest advantage of selection sort?

a. its has low time complexity

b. it has low space complexity

c. it is easy to implement

d. it requires only n swaps under any condition

  • d. it requires only n swaps under any condition

Q. What will be the recurrence relation of the code of recursive selection sort?

a. t(n) = 2t(n/2) + n

b. t(n) = 2t(n/2) + c

c. t(n) = t(n-1) + n

d. t(n) = t(n-1) + c

  • c. t(n) = t(n-1) + n

Q. Which of the following sorting algorithm is NOT stable?

a. selection sort

b. brick sort

c. bubble sort

d. merge sort

  • a. selection sort

Q. What will be the best case time complexity of recursive selection sort?

a. o(n)

b. o(n2)

c. o(log n)

d. o(n log n)

  • b. o(n2)

Q. What will be the cross product of the vectors 2i + 3j + k and 3i + 2j + k?

a. i + 2j + k

b. 2i + 3j + k

c. i + j – 5k

d. 2i – j – 5k

  • c. i + j – 5k

Q. Which of the following is false in the case of a spanning tree of a graph G?

a. it is tree that spans g

b. it is a subgraph of the g

c. it includes every vertex of the g

d. it can be either cyclic or acyclic

  • d. it can be either cyclic or acyclic

Q. Which of the following is the most commonly used data structure for implementing Dijkstra’s Algorithm?

a. max priority queue

b. stack

c. circular queue

d. min priority queue

  • d. min priority queue

Q. Floyd- Warshall algorithm was proposed by                          

a. robert floyd and stephen warshall

b. stephen floyd and robert warshall

c. bernad floyd and robert warshall

d. robert floyd and bernad warshall

  • a. robert floyd and stephen warshall

Q. Who proposed the modern formulation of Floyd-Warshall Algorithm as three nested loops?

a. robert floyd

b. stephen warshall

c. bernard roy

d. peter ingerman

  • d. peter ingerman

Q. What happens when the value of k is 0 in the Floyd Warshall Algorithm?

a. 1 intermediate vertex

b. 0 intermediate vertex

c. n intermediate vertices

d. n-1 intermediate vertices

  • b. 0 intermediate vertex
Subscribe Now

Get All Updates & News