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

From 121 to 135 of 152

Q. Which of the following sorting algorithms is the fastest?

a. merge sort

b. quick sort

c. insertion sort

d. shell sort

  • b. quick sort

Q. What is the worst case time complexity of a quick sort algorithm?

a. o(n)

b. o(n log n)

c. o(n2)

d. o(log n)

  • c. o(n2)

Q. Which of the following methods is the most effective for picking the pivot element?

a. first element

b. last element

c. median-of-three partitioning

d. random element

  • c. median-of-three partitioning

Q. Which is the safest method to choose a pivot element?

a. choosing a random element as pivot

b. choosing the first element as pivot

c. choosing the last element as pivot

d. median-of-three partitioning method

  • a. choosing a random element as pivot

Q. What is the average running time of a quick sort algorithm?

a. o(n2)

b. o(n)

c. o(n log n)

d. o(log n)

  • c. o(n log n)

Q. Which of the following sorting algorithms is used along with quick sort to sort the sub arrays?

a. merge sort

b. shell sort

c. insertion sort

d. bubble sort

  • c. insertion sort

Q. Which is the worst method of choosing a pivot element?

a. first element as pivot

b. last element as pivot

c. median-of-three partitioning

d. random element as pivot

  • a. first element as pivot

Q. The shortest distance between a line and a point is achieved when?

a. a line is drawn at 90 degrees to the given line from the given point

b. a line is drawn at 180 degrees to the given line from the given point

c. a line is drawn at 60 degrees to the given line from the given point

d. a line is drawn at 270 degrees to the given line from the given point

  • a. a line is drawn at 90 degrees to the given line from the given point

Q. What is the shortest distance between the line given by -2x + 3y + 4 = 0 and the point (5,6)?

a. 4.5 units

b. 5.4 units

c. 4.3 units

d. 3.3 units

  • d. 3.3 units

Q. What is the distance between the lines 3x- 4y+7=0 and 3x-4y+5=0?

a. 1 unit

b. 0.5 unit

c. 0.8 unit

d. 0.4 unit

  • d. 0.4 unit

Q. What will be the slope of the line given by ax + by + c = 0?

a. -a/b

b. -b/a

c. -c/a

d. a/c

  • a. -a/b
Subscribe Now

Get All Updates & News