GATE DA 2024 · Question 45 · Programming, Data Structures and Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Consider the following sorting algorithms:
(i) Bubble sort
(ii) Insertion sort
(iii) Selection sort
Which ONE among the following choices of sorting algorithms sorts the numbers in the array [4, 3, 2, 1, 5] in increasing order after exactly two passes over the array?

  1. (A) (i) only
  2. (B) (iii) only
  3. (C) (i) and (iii) only
  4. (D) (ii) and (iii) only
Answer

Answer (B)

Answer from the official GATE DA 2024 answer key.

The step-by-step solution, where available, is part of GATE DA Pro. See what Pro includes