Select The Appropriate Code That Performs Selection Sort #587
Select the appropriate code that performs selection sort.
This multiple choice question (MCQ) is related to the book/course gs gs122 Data Communication and Computer Network. It can also be found in gs gs122 Sorting - Selection Sort - Quiz No.1.
Select the appropriate code that performs selection sort.
int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=arr.length-1; k++) { if(arr[k] < arr[min]) min = k; } int temp = arr[min]; arr[min] = arr[j]; arr[j] = temp; }
int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=arr.length; k++) { if(arr[k] < arr[min]) min = k; } int temp = arr[min]; arr[min] = arr[j]; arr[j] = temp; }
int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=arr.length-1; k++) { if(arr[k] > arr[min]) min = k; } int temp = arr[min]; arr[min] = arr[j]; arr[j] = temp; }
int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=arr.length; k++) { if(arr[k] > arr[min]) min = k; } int temp = arr[min]; arr[min] = arr[j]; arr[j] = temp; }
Similar question(s) are as followings:
Online Quizzes of gs122 Data Communication and Computer Network
Sorting - Insertion Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.3
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - LSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes