The Following Function Represents Which Sortingp Pre Langc #840

The following function represents which sorting?</p> <pre><code class="language-c"> void Sorting(int a[], int n) { bool swap = true; int first = 0; int last = n - 1; while (swap) { swap = false; for (int i = first; i < last;i++) { if (a[i] > a[i + 1]) { swap(a[i], a[i + 1]); swap = true; } } if (!swap) break; swap = false; --last; for (int i = last - 1; i >= first; i--) { if (a[i] > a[i + 1]) { swap(a[i], a[i + 1]); swap = true; } } ++first; } } </code></pre>

Online Quiz 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 - Cocktail Sort - Quiz No.2.


Similar question(s) are as followings:



Online Quizzes of gs122 Data Communication and Computer Network

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background