Пример #1
0
 public void ArrToObsColl(string[] arr)
 {
     foreach (string str in arr)
     {
         SortedText.Add(str);
     }
 }
Пример #2
0
 public void ClearInfo()
 {
     SortedTextWords.Clear();
     SortedText.Clear();
     WordsInText       = 0;
     UniqueWordsInText = 0;
     MergeSortingTime  = 0;
     BubbleSortingTime = 0;
     UpdateInfo();
 }
        public void SortText(int sortIndex)
        {
            SortedText inputText = new SortedText();

            switch (sortIndex)
            {
            case (int)SortingStrategy.BubbleSort:
                inputText.SetSortStrategy(new BubbleSortStrategy());
                this._view.OutputText = inputText.Sort(this._view.InputText);
                break;

            case (int)SortingStrategy.QuickSort:
                inputText.SetSortStrategy(new QuickSortStrategy());
                this._view.OutputText = inputText.Sort(this._view.InputText);
                break;

            default:
                this._view.OutputText = "Invalid Sorting Method";
                break;
            }
        }