- C Task Continue Correct These Codes And Make It Run Code Include Iostream Using Namespace Std Int Selectionsort 1 (15.55 KiB) Viewed 31 times
C++ Task: Continue/correct these codes and make it run. Code: #include using namespace std; int selectionSort
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
C++ Task: Continue/correct these codes and make it run. Code: #include using namespace std; int selectionSort
C++ Task: Continue/correct these codes and make it run. Code: #include <iostream> using namespace std; int selectionSort(int a[], int n) { } int ij,small,temp; for(i=0; i<n-1; i++) { } small = i; for(j=i+1; j<n; j++) { if(a[j] <a[small]) small = j; } temp = a; a = a[small]; Argument/Input: a=array of elements n= size of array/number of elements small=smallest element index i=left most element index j=looping through the unsorted sub-array