Beispiel #1
0
        public void Run()
        {
            var items = new List<int>() { 3, 7, 4, 9, 5, 2, 6, 1 };
            Console.WriteLine("items: \t\t{0}", string.Join(", ", items));

            var sorter = new Sorter(items, new IntComparator());
            var result = sorter.Sort() as List<int>;
            Console.WriteLine("items up: \t{0}", string.Join(", ", result));

            var sorter2 = new Sorter(items, new IntComparator(Direction.Down));
            var result2 = sorter2.Sort() as List<int>;
            Console.WriteLine("items down: \t{0}", string.Join(", ", result2));
        }