Insertion sort function-
void insertion_sort(int arr[], int n) { int i,j,value; for(i=1;i<n;i++) { value=arr[i]; for(j=i-1;j>=0 && arr[j]>value;j--) { arr[j+1]=arr[j]; } arr[j+1]=value; } }
No comments:
Post a Comment