static void Main(string[] args) { var list = CreateLongList(); SortingStrategy sortedStrategy = new SortingStrategy(); sortedStrategy.SortingAlgorithm = new SelectionSort(); sortedStrategy.List = new List <int>(list); sortedStrategy.Sort(); sortedStrategy.SortingAlgorithm = new QuickSort(); sortedStrategy.List = new List <int>(list); sortedStrategy.Sort(); }
public void Sort() { _sortingStrategy.Sort(_list); foreach (var item in _list) { Console.Write(item + " "); } }