Study the code of insertion sort and selection sort and beefily explain why on average, insertion sort is faster than selection sort by a constant factor.

???????
6. Write a program to sort an array using insertion sort algorithm. \#include ?conio.h? \#define size 5 void insertion_sort(int arr[], int n ); void main() f int arr[ size], i, n; printf("\n Enter the number of elements in the array: "); scanf(-Yd", \&n); printf(" \ n Enter the elements of the array: "); for (i=?;i<n;i++) i scanf("\%d", \&arr[i]); \} insertion_sort (arr, n); printf(" \n? The sorted array is: \n?); for (i=0;i<n;i++) printf(- %d\t?, arr[i]); getch(); \} void insertion_sort(int arr[], int n ) f int i,j, temp; for (i=1;i<n;i++) \& temp =arr[i] j=i?1; while (( temp <arr[j])&&(j>=0)) \{ arr[j+1]=arr[j]; j??j \} arr[j+1]= temp; \} 3 Output Enter the number of elements in the array : 5 Enter the elements of the array : 5001502376 The sorted array is:
7. Write a program to sort an array using selection sort algorithm. int smallest(int arr[], int k, int n ); void selection_sort(int arr[], int n ); void main(int argc, char *argv[]) \{ int arr[10],i,n; printf("\n Enter the number of elements in the array: "); scanf(?%d?,&n); printf("\n Enter the elements of the array: "); for (i=0;i<n;i++) \{ scanf("\%d", sarr[i]); \} selection_sort (arrr,n); printf( \ n The sorted array is: \n??); for (i=0;i<n;i++) printf(" \%d\t", arr[i]); 3 int smallest(int arr[], int k, int n ) f int pos =k, sma1l=arr [k],i; for (i=k+1;i<n;i++) \{ if(arr [i]<sma11) \{ sma11=arr[i] pos =i; 3 return pos; 3 void selection_sort (int arr[], int n ) \{ int k, pos, temp; for (k=0;k<n;k++) \{ pos =smallest(arr,k,n) temp =arr[k]