Write a c function select sort that will sort an array of n


Question: Write a C++ function select sort that will sort an array of n integers in ascending order. Here is a selection sort algorithm that is so named because for each array position it selects the correct value to place there and swaps it with the value currently in that position. 1. Repeat for each array position to Fill from 0 to n - 2. 2. Let small Pos be the subscript of the smallest value in array elements to Fill. . n - I. 3. If small Pos to Fill, swap list [small Pos] and list [to Fill]. We can refine Step 2: 2.1 Initialize small Pos to to Fill. 2.2 Repeat for pos ranging from to Fill to n - 1. 2.3 If list [pos] is smaller than list [ small Pos ] 2.4 Copy the value of pos into small Pos. Also write a main function that inputs a list of numbers and displays the list before and after sorting. Test your program on a list in random order, on a list that is already in order, and on a list sorted in descending order.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a c function select sort that will sort an array of n
Reference No:- TGS02578028

Expected delivery within 24 Hours