Sorting: GATE CS Previous Year Questions

Sorting · Algorithms

24 questions · asked in 15 of 27 years (2000–2026)

MCQ 22 · NAT 21-mark 17 · 2-mark 7

2000Questions per year2026

Questions 21–24 of 24

Q21GATE 20041 markMCQ−0.33 if wrong
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of

Q22GATE 20031 markMCQ−0.33 if wrong
In a permutation a1.....ana_1.....a_n of n distinct integers, an inversion is a pair (ai,aj)(a_i, a_j) such that i<ji \lt j and ai>aja_i \gt a_j.

What would be the worst case time complexity of the insertion Sort algorithm, if the inputs are restricted to permutations of 1....n with at most n inversions?

Q23GATE 20031 markMCQ−0.33 if wrong
The usual Θ(n2)\Theta (n^{2}) implementation of Insertion Sort to sort an array uses linear search to identify the position where an element is to be inserted into the already sorted part of the array. If, instead, we use binary search to identify the position, the worst case running time will

Q24GATE 20011 markMCQ−0.33 if wrong
Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using randomized quicksort ?

Keep practising

Topics in Algorithms

All CS topics ›