Choose The Correct Function For Stooge Sort #992
Choose the correct function for stooge 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 - Stooge Sort - Quiz No.2.
Choose the correct function for stooge sort?
void stooge_sort(int arr[], int l, int r) { if (l >= r) return; if (arr[l] > arr[r]) swap(arr[l], arr[h]); if (r - l + 1 > =3) { int p = (r - l + 1) / 3; stooge_sort(arr, l, r - p); stooge_sort(arr, l + p, r); stooge_sort(arr, l, r - p); } }
void stooge_sort(int arr[], int l, int r) { if (l >= r) return; if (arr[l] < arr[r]) swap(arr[l], arr[h]); if (r - l + 1 >=3) { int p = (r - l + 1) / 3; stooge_sort(arr, l, r - p); stooge_sort(arr, l + p, r); stooge_sort(arr, l, r - p); } }
void stooge_sort(int arr[], int l, int r) { if (l >= r) return; if (arr[l] > arr[r]) swap(arr[l], arr[h]); if (r - l + 1 > =3) { int p = (r - l + 1) / 3; stooge_sort(arr, l, r - p); stooge_sort(arr, l, r - p); stooge_sort(arr, l + p, r); } }
void stooge_sort(int arr[], int l, int r) { if (l >= r) return; if (arr[l] > arr[r]) swap(arr[l], arr[h]); if (r - l + 1 >=3) { int p = (r - l + 1) / 3; stooge_sort(arr, l + p, r); stooge_sort(arr, l, r - p); stooge_sort(arr, l, r - p); } }
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