Esempio n. 1
0
        public static void Main()
        {
            MyLinkedList list = new MyLinkedList();

            list.Add(8);
            list.Add(2);
            list.Add(4);
            list.Add(-1);
            list.Add(6);

            Console.WriteLine(list);
            MergeSort(ref list.Root);
            Console.WriteLine(list);
        }
        public static void Main()
        {
            MyLinkedList list  = new MyLinkedList();
            var          array = File.ReadAllLines("RandomData.txt").Select(x => int.Parse(x)).ToArray();

            foreach (var e in array)
            {
                list.Add(e);
            }
            var stopWatch = new Stopwatch();

            stopWatch.Start();
            Console.WriteLine(list);
            MergeSort(ref list.Root);
            stopWatch.Stop();
            Console.WriteLine(stopWatch);
            Console.WriteLine(list);
        }