#include using namespace std ; //Selection Sort void showArray(const int array[], int size) { for (int count = 0; count < size; count++) cout << array[count] << " "; cout << endl; } void insertionSort(int array[], int size) { int startScan, minIndex, minValue; for (int i1 = 1; i1 < size ; i1++) { for( int j1=i1 ; j1 > 0 ; j1-- ) { if( array[j1] < array[j1-1] ) { int temp = array[j1]; array[j1] = array[j1-1]; array[j1-1] = temp; } } //for showArray( array , 5 ) ; } //for } int main() { int arr1[] = { 5 , 4 , 3 , 2 , 1 } ; showArray( arr1 , 5 ) ; insertionSort( arr1, 5 ) ; showArray( arr1 , 5 ) ; return ( 0 ) ; }