#include "sort.h"
#include "system.h"
#include "stdio.h"

//------ simple_sort -------------------------------
void sort_selection(unsigned int *base, unsigned int n)
{
     int i, min, j , x;

     for(i = 0 ; i < n - 1 ; i++)
     {

#if VERBOSE_SORT
         printf("-"); // added for debug
#endif

         min = i;
         
         for(j = i+1 ; j < n ; j++)
         {
        
            if(base[j] < base[min])
                  min = j;
            
         }

         if(min != i)
         {
             x = base[i];
             base[i] = base[min];
             base[min] = x;
         }

#if VERBOSE_SORT
         printf("+"); // added for debug
#endif
     }
#if VERBOSE_SORT
    printf("\n");
#endif
}
