/// <summary> /// Sorts the List according to the method and direction you choose /// </summary> /// <param name="method">Which sorting algorith you would like to use</param> /// <param name="direction">Sort in Ascending or Descending order</param> public void sortList(SortMethods method, SortDirection direction) { // A List of 0 or 1 values has already been sorted if (valueList.Count < 2) { return; } switch (method) { case SortMethods.BubbleSort: this.bubbleSort(direction); break; case SortMethods.InsertionSort: this.insertionSort(direction); break; case SortMethods.SelectionSort: this.selectionSort(direction); break; case SortMethods.QuickSort: this.quickSort(direction, 0, -1); break; default: throw new Exception(method.ToString() + " has not been implemented yet"); break; } }