using System;
using System.Collections.Generic;
using System.Text;
namespace SortAlgorithms
{
public class SelectionSorter
{
private int min;
public void Sort(int[] arr)
{
for (int i = 0; i < arr.Length-1 ; i++)
{
min = i;
for (int j = i + 1; j < arr.Length; j++)
{
if (j - 1 > 0)
{
if (arr[j - 1] < arr[min])
{
min = j - 1;
}
int t = arr[min];
arr[min] = arr[i];
arr[i] = t;
}
}
}
}
//static void Main(string[] args)
//{
// int[] arry = new int[] { 1,2,54,3,65};
// SelectionSorter s = new SelectionSorter();
// s.Sort(arry);
// foreach (int m in arry)
// {
// Console.WriteLine("{0}",m);
// }
// Console.ReadLine();
//}
}
}