Exemplo n.º 1
0
        public static void Main(String[] args)
        {
            TreeSort tree = new TreeSort();

            int[] arr = { 41, 93, 18, 2, 74, 56, 60, 19, 24, 63, 29 };
            CommonFunctions.PrintInitial(arr);

            tree.InsertToTree(arr);
            tree.inorderRec(tree.Root);

            Console.WriteLine("Root value: " + tree.Root.Key);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.Write("Input data: ");
            var input = Console.ReadLine().Split(" ");
            var data  = new List <string>();

            foreach (var item in input)
            {
                data.Add(item);
            }
            Console.Write("Sorted data: ");
            foreach (var item in TreeSort.GetSortedList(data))
            {
                Console.Write(item + " ");
            }
            Console.ReadKey();
        }