private static void SearchAlgorithmShell(Func<IList<int>, int, int?> searchingFunction, IList<int> sortedList, bool printCollection = false) { if (printCollection) sortedList.PrintCollection(); var timer = new Timer(); var element = sortedList.GetElementContainedInList(); timer.Start(); var elementIndex = sortedList.Search(element, searchingFunction); Console.WriteLine("{0}{1} seconds", searchingFunction.Method.Name.PadRight(40), timer.GetTime()); if (printCollection) { Console.WriteLine("Element {0} at {1} position".PadLeft(40), element, elementIndex); } }