Esempio n. 1
0
        public Algorithm(AlgorithmType algorithmType, string fileName)
        {
            FileName = fileName;

            switch (algorithmType)
            {
            case AlgorithmType.Insertion:
            {
                SortAlgoritm = new InsertionSort(tempDirectory);
                break;
            }

            case AlgorithmType.Merge:
            {
                SortAlgoritm = new MergeSort(tempDirectory);
                break;
            }

            default:
                throw new ArgumentException($"unknown algorithm {algorithmType}");
            }
        }
Esempio n. 2
0
 public Sorter(ISortAlgoritm sortAlgoritm)
 {
     _sortAlgoritm = sortAlgoritm;
 }