public static SortingAlgorithmBase GetAlgorithm(ISortingHandable handleable, SortingTypes sortingType)
    {
        SortingAlgorithmBase result = null;

        switch (sortingType)
        {
        case SortingTypes.Bubble:
            result = SortingAlgorithmCreator.CreateBubbleSorting(handleable);
            break;

        case SortingTypes.Shaker:
            result = SortingAlgorithmCreator.CreateShakerSorting(handleable);
            break;

        case SortingTypes.Insertion:
            result = SortingAlgorithmCreator.CreateInsertionSorting(handleable);
            break;

        case SortingTypes.InsertionBinary:
            result = SortingAlgorithmCreator.CreateInsertionBinarySorting(handleable);
            break;
            //case SortingTypes.QuickSort:
            //    result = SortingAlgorithmCreator.CreateQuickSort(handleable);
            //    break;
        }
        return(result);
    }
 public ShakerSorting(ISortingHandable handleable) : base(handleable)
 {
 }
 private static SortingAlgorithmBase CreateInsertionBinarySorting(ISortingHandable handleable)
 {
     return(new InsertionBinarySorting(handleable));
 }
 private static SortingAlgorithmBase CreateQuickSort(ISortingHandable handleable)
 {
     return(new QuickSorting(handleable));
 }
 private static SortingAlgorithmBase CreateShakerSorting(ISortingHandable handleable)
 {
     return(new ShakerSorting(handleable));
 }
 private static SortingAlgorithmBase CreateBubbleSorting(ISortingHandable handleable)
 {
     return(new BubbleSorting(handleable));
 }
 public QuickSorting(ISortingHandable sortingHandable) : base(sortingHandable)
 {
 }
Esempio n. 8
0
 public InsertionSorting(ISortingHandable handleable) : base(handleable)
 {
 }
Esempio n. 9
0
 public BubbleSorting(ISortingHandable handleable) : base(handleable)
 {
 }