Example #1
0
        private void ExectuteProgram()
        {
            int amountOfSearchesToPerform = 100;
            var downloadWords             = new DownloadWords();
            var randomWords = new Program().SelectWords(downloadWords).Take(amountOfSearchesToPerform);
            var search      = new Searches();

            foreach (var word in randomWords)
            {
                search.LinearSearch(word);
                search.BinarySearch(word);
            }

            var combinedLinearSearchTime = TotalSearchTimes("linear", search);
            var combinedBinarySearchTime = TotalSearchTimes("binary", search);

            PrintResults(combinedLinearSearchTime, combinedBinarySearchTime, amountOfSearchesToPerform);
            Console.ReadLine();
        }