Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine()
                          .Split()
                          .Select(int.Parse)
                          .ToArray();

            Quick.Sort(input, 0, input.Length - 1);

            Console.WriteLine(string.Join(" ", input));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string input = Console.ReadLine();

            if (input == String.Empty)
            {
                return;
            }

            int[] arr = input
                        .Split()
                        .Select(int.Parse)
                        .ToArray();

            Quick.Sort(arr);

            Console.WriteLine(String.Join(" ", arr));
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Student[] students =
            {
                new Student("Ivo", 4.1),
                new Student("Ana", 4.9),
                new Student("Iva", 4.3),
                new Student("Bob", 4.5),
                new Student("Joe", 4.7),
                new Student("Tom", 4.4),
                new Student("Iko", 4.6),
            };

            DisplayArrayToConsole(students);

            Quick.Partition(students, 0, students.Length - 1, Student.CompareName);
            DisplayArrayToConsole(students);

            Quick.Sort(students, 0, students.Length - 1, Student.CompareName);
            DisplayArrayToConsole(students);

            Quick.Sort(students, 0, students.Length - 1, Student.CompareGrade);
            DisplayArrayToConsole(students);
        }
Ejemplo n.º 4
0
        private void QuickSort_Click(object sender, EventArgs e)
        {
            var quick = new Quick <SortedItem>(items);

            BtnClick(quick);
        }