Exemplo 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}");
            }
        }
Exemplo n.º 2
0
 public Sorter(ISortAlgoritm sortAlgoritm)
 {
     _sortAlgoritm = sortAlgoritm;
 }