Open In App
Related Articles

GATE | GATE CS Mock 2018 | Question 54

Improve Article
Save Article
Like Article

Consider the below Program and identify the problem:


void fun2(int arr[], int start_index, int end_index)
    if (start_index >= end_index)
    int min_index;
    int temp;
    min_index = minIndex(arr, start_index, end_index);
    swap(arr[start_index], arr[min_index]);
    fun2(arr, start_index + 1, end_index);


Selection Sort Recursive implementation


Bubble sort Recursive implementation


Finding Pair Recursive implementation


None of these

Answer: (A)


The function fun2() is a recursive implementation of Selection Sort.

Hence Option(A) is the correct answer.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 03 Jan, 2018
Like Article
Save Article
Similar Reads