- usingSystem;
- namespaceSelectionSorter
- {
- publicclassSelectionSorter
- {
- privateintmin;
- publicvoidSort(int[]list)
- {
- for(inti=0;i<list.Length-1;i++)
- {
- min=i;
- for(intj=i+1;j<list.Length;j++)
- {
- if(list[j]<list[min])
- min=j;
- }
- intt=list[min];
- list[min]=list[i];
- list[i]=t;
- }
- }
- }
- publicclassMainClass
- {
- publicstaticvoidMain()
- {
- int[]iArrary=newint[]{1,5,3,6,10,55,9,2,87,12,34,75,33,47};
- SelectionSorterss=newSelectionSorter();
- ss.Sort(iArrary);
- for(intm=0;m<iArrary.Length;m++)
- {
- Console.Write("{0}",iArrary[m]);
- Console.WriteLine();
- }
- }
- }
- }