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

12/26

Page

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

What is the average case running time of an insertion sort algorithm?

Select an option to see the answer and solution.

Recursive bubble sort is a comparison based sort.

Select an option to see the answer and solution.

There is one small error in the following flip routine. Find out which line it is on.
1	void flip(int arr[], int i)
2	{
3	      int t, init = 0;
4	      while (init < i)
5	      {
6		    t = arr[init];
7		    arr[i] = arr[init] ;
8		    arr[i] = t;
9		    init++;
10		    i--;
11	      }
12	}

Select an option to see the answer and solution.

Insertion sort is an example of an incremental algorithm.

Select an option to see the answer and solution.

Who invented the shell sort algorithm?

Select an option to see the answer and solution.

Which of the following method is used for sorting in merge sort?

Select an option to see the answer and solution.

How many arrays are required to perform deletion operation in a heap?

Select an option to see the answer and solution.

What is the average case time complexity of recursive insertion sort?

Select an option to see the answer and solution.

How many comparisons will be made in the worst case when an array of size n will be sorted by using a binary insertion sort algorithm?

Select an option to see the answer and solution.

In which of the following case stooge sort is most efficient (in terms of time complexity)?

Select an option to see the answer and solution.

What is an in-place sorting algorithm?

Select an option to see the answer and solution.

Merge sort is preferred for arrays over linked lists.

Select an option to see the answer and solution.

Shell sort uses a sequence called a incrementing sequence to sort the elements.

Select an option to see the answer and solution.

Which of the following examples represent the worst case input for an insertion sort?

Select an option to see the answer and solution.

Which of the following is not true about MSD radix sort?

Select an option to see the answer and solution.

What will be the base case for the code of recursive bubble sort?

Options are not available for this question.

Select an option to see the answer and solution.

How many iterations are required to sort the array arr={2, 3, 4, 5, 1} using bubble sort and cocktail sort respectively?

Select an option to see the answer and solution.

Which of the following is a non-comparison sort?

Select an option to see the answer and solution.

How many sub arrays does the quick sort algorithm divide the entire array into?

Select an option to see the answer and solution.

What is the general form of Shell's increments?

Select an option to see the answer and solution.