data structures using thusn- comparisons are required in the first pass thenthe smallest value is swapped with the element in the first position in pass selecting the second smallest value requires scanning the remaining elements and so on therefore( ( ( ( comparisons advantages of selection sort it is simple and easy to implement it can be used for small data sets it is per cent more efficient than bubble sort howeverin case of large data setsthe efficiency of selection sort drops as compared to insertion sort programming example write program to sort an array using selection sort algorithm #include #include #include int smallest(int arr[]int kint )void selection_sort(int arr[]int )void main(int argcchar *argv[]int arr[ ]inprintf("\ enter the number of elements in the array")scanf("% "& )printf("\ enter the elements of the array")for( = ; < ; ++scanf("% "&arr[ ])selection_sort(arrn)printf("\ the sorted array is\ ")for( = ; < ; ++printf(% \ "arr[ ])int smallest(int arr[]int kint nint pos ksmall=arr[ ]ifor( = + ; < ; ++if(arr[ ]smallsmall arr[ ]pos ireturn posvoid selection_sort(int arr[],int nint kpostempfor( = ; < ; ++pos smallest(arrkn)temp arr[ ]