GATE Assistant

Past questions › Data Science and Artificial Intelligence › GATE 2024

GATE 2024 · DA · MCQ · 2 marks · Programming, Data Structures and Algorithms › Basic Sorting

GATE 2024 Data Science and Artificial Intelligence question: Consider the following sorting algorithms: (i) Bubble sort (ii) Insertion sort (iii)…

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

Show answer

Official answer: B

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion