Sorting


Question 1
Consider the following array.

\begin{array}{|l|l|l|l|l|l|l|l|} \hline 23&32&45&69&72&73&89&97 \\ \hline\end{array}

Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order?
A
Selection sort
B
Mergesort
C
Insertion sort
D
Quicksort using the last element as pivot
GATE CSE 2021 SET-1   Algorithm
Question 2
Of the following sort algorithms, which has execution time that is least dependant on initial ordering of the input?
A
Insertion sort
B
Quick sort
C
Merge sort
D
Selection sort
ISRO CSE 2020   Algorithm


Question 3
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is _________.
A
0.08
B
0.0016
C
0.04
D
0.0008
GATE CSE 2019   Algorithm
Question 4
Of the following sorting algorithms, which has a running time that is least dependent on the initial ordering of the input?
A
Mege Sort
B
Insertion Sort
C
Selection Sort
D
Quick Sort
ISRO CSE 2018   Algorithm
Question 5
Given two sorted list of size m and n respectively. The number of comparisons needed the worst case by the merge sort algorithm will be:
A
m-n
B
maximum of m and n
C
minimum of m and n
D
m+n-1
ISRO CSE 2018   Algorithm


There are 5 questions to complete.

3 thoughts on “Sorting”

Leave a Comment