Vidyalelo
Data Structure · all questions

Sorting Algorithms
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

509

Questions

19/26

Page

Pick an option on a question to see the right answer and solution.

An array that is first 7-sorted, then 5-sorted becomes . . . . . . . .

Select an option to see the answer and solution.

How many recursive statements are used in the algorithm of stooge sort?

Select an option to see the answer and solution.

In how many comparisons does the array arr={1, 4, 2, 3, 5} gets sorted if we use sleep sort?

Select an option to see the answer and solution.

What is the worst case time complexity of introsort?

Select an option to see the answer and solution.

Which of the following is correct with regard to insertion sort?

Select an option to see the answer and solution.

What is the space complexity of in place merge sort?

Select an option to see the answer and solution.

Sleep sort works by . . . . . . . .

Select an option to see the answer and solution.

Heap sort is faster than Shell sort.

Select an option to see the answer and solution.

Statement 1: In insertion sort, after m passes through the array, the first m elements are in sorted order.
Statement 2: And these elements are the m smallest elements in the array.

Select an option to see the answer and solution.

What is the average time complexity of randomized quick sort?

Select an option to see the answer and solution.

There is a one line error in the following routine. Find that line.
1.	int Max(int a[], int n)
2.	{
3.		  int mi, i;
4.		  for (mi = 0, i = 0; i < n; i++)
5.		  if (a[i] > a[mi])
6.		  mi = i;
7.		  return mi;
8.	}

Select an option to see the answer and solution.

What is the worst case time complexity of randomized quicksort?

Select an option to see the answer and solution.

What is the time taken to copy elements to and from two arrays created for deletion?

Select an option to see the answer and solution.

Which of the following is not true about bucket sort?

Select an option to see the answer and solution.

What is the worst case time complexity of permutation sort?

Select an option to see the answer and solution.

Pigeonhole sort is a stable sorting algorithm.

Select an option to see the answer and solution.

What is the average number of inversions in an array of N distinct numbers?

Select an option to see the answer and solution.

Cocktail sort uses which of the following methods for sorting the input?

Select an option to see the answer and solution.

Which of the following is Python's standard sorting algorithm?

Select an option to see the answer and solution.

The given array is arr = {2, 3, 4, 1, 6}. What are the pivots that are returned as a result of subsequent partitioning?

Select an option to see the answer and solution.