/* * selection_sort.c * * Sort an array, by gradually building up the sorted array. * At each iteration: * - The beginning part of the array contains the lowest elements, * in sorted order. * - Find the minimum element in the unsorted part of the array. * - Add it to the end of the sorted part. */ #include void print_array(int n, int a[]) { int i; for (i=0; i