Ejemplo n.º 1
0
        public void Execute()
        {
            Bubble sort = new Bubble();

            int[] numbers = sort.Ascending(GetRandomNumbers(25));

            Console.WriteLine("Input: " + String.Join(',', numbers));
            Console.WriteLine("Search Item: ");
            int item = Convert.ToInt32(Console.ReadLine());

            Console.Write("Searching...");
            int position = Find(numbers, item);

            if (position > -1)
            {
                Console.WriteLine($"{item} found on Position {position}");
            }
            else
            {
                Console.WriteLine($"{item} not exist in list");
            }
        }