Top 150+ Solved Design and Analysis of Algorithms MCQ Questions Answer
Q. Which of the following sorting algorithms is the fastest?
a. merge sort
b. quick sort
c. insertion sort
d. shell 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)
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
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
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)
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
Q. How many sub arrays does the quick sort algorithm divide the entire array into?
a. one
b. two
c. three
d. four
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
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
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
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