Choose The Correct Function For Recursive Insertion Sort #573
Choose the correct function for recursive insertion 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 - Insertion Sort - Quiz No.2.
Choose the correct function for recursive insertion sort?
void RecInsertionSort(int arr[], int n) { if (n <= 1) return; RecInsertionSort( arr, n-1 ); int key = arr[n-1]; int j = n-2; while (j >= 0 && arr[j] > key) { arr[j+1] = arr[j]; j--; } arr[j+1] = key; }
void RecInsertionSort(int arr[], int n) { if (n < 1) return; RecInsertionSort( arr, n-1 ); int key = arr[n-1]; int j = n-2; while (j >= 0 || arr[j] > key) { arr[j+1] = arr[j]; j--; } arr[j] = key; }
void RecInsertionSort(int arr[], int n) { if (n <1) return; RecInsertionSort( arr, n-1 ); int key = arr[n-1]; int j = n-2; while (j >= 0 && arr[j] > key) { arr[j+1] = arr[j]; j--; } arr[j] = key; }
void RecInsertionSort(int arr[], int n) { if (n <= 1) return; RecInsertionSort( arr, n-1 ); int key = arr[n-1]; int j = n-1; while (j >= 0 || arr[j] > key) { arr[j+1] = arr[j]; j--; } arr[j+1] = key; }
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