3 Qs · since 2015 · 3 marks · 0.1 marks/paperStandard yield
In this topic, GATE tests the performance characteristics and comparison counts of classic sorting algorithms under specific input configurations (such as already sorted arrays). Q… Guide
fun() is given below:
fun(int A[0,...,n-1]){
for i=0 to n-2
for j=0 to n-i-2
if (A[j]>A[j+1])
then swap A[j] and A[j+1]
}
Let be an array storing 30 distinct integers in descending order. The number of…Topic guide
In this topic, GATE tests the performance characteristics and comparison counts of classic sorting algorithms under specific input configurations (such as already sorted arrays). Questions focus on identifying best-case vs. worst-case behaviors, comparison complexity bounds, and algorithm-specific adaptability.
Time-Scaling Proportionality Calculation
occasional · MCQ · 1 marks · 2015
Given the execution time of a comparison-based sort (like Merge Sort) for a specific input size , calculate the maximum input size solvable within an expanded time limit assuming .
Pseudocode Operation Counting
occasional · NAT · 1 marks · 2025
Given a sorting loop structure (such as nested loops of Bubble Sort) and a specific input configuration (such as reverse sorted array), calculate the exact number of key operations (comparisons or swaps) executed.
Comparison Count on Specific Input Presets
common · MCQ · 1 marks · 2021
An input array with specific properties (e.g., pre-sorted array) is provided, and the candidate must evaluate which sorting algorithm performs the minimum or maximum number of element comparisons.
Merge Sort Running Time Relation
Used to compute scaling factor and solve for target problem size given execution time.
Worst-case Bubble Sort Swaps (Inversion Count)
Used to calculate the exact number of swap operations performed by standard bubble sort on a strictly decreasing array of size .
Insertion Sort Best-Case Comparisons
Calculated when the input array is already sorted in ascending order.
Selection Sort Total Comparisons
Evaluated for Selection Sort regardless of input order as it always scans the remaining unsorted subarray.
Quicksort Worst-Case Comparisons (End Pivot on Sorted Array)
Evaluated when an already sorted array is partitioned using the first or last element as the pivot.
Shift from multiple-choice questions on asymptotic scaling ratios to numerical answer type (NAT) questions assessing exact step counts on standard sorting pseudocode.
2025, 2015
Questions test fundamental behavior by presenting an explicit array to verify whether candidates recognize pre-sorted inputs and map them to the best-case time and comparison complexity of standard algorithms.
2021
Easy questions require standard formula application such as for loop bounds on an array of size . Medium questions involve multi-step arithmetic where constants must be resolved and non-linear equations (like ) matched against power-of-two choices.