Beispiel #1
0
        static void RunLinkedList()
        {
            Node head              = null;
            var  testsAmount       = Int32.Parse(Console.ReadLine());
            var  coderInThirtyDays = new CoderInThirtyDays();

            while (testsAmount-- > 0)
            {
                var data = Int32.Parse(Console.ReadLine());
                head = coderInThirtyDays.InsertNodeToLinkedList(head, data);
            }
            coderInThirtyDays.DisplayLinkedList(head);
        }
Beispiel #2
0
        static void RunMoreLinkedLists()
        {
            Node head              = null;
            var  nodesAmount       = Int32.Parse(Console.ReadLine());
            var  coderInThirtyDays = new CoderInThirtyDays();

            while (nodesAmount-- > 0)
            {
                var data = Int32.Parse(Console.ReadLine());
                head = coderInThirtyDays.InsertNodeToLinkedList(head, data);
            }
            head = coderInThirtyDays.RemoveDuplicatesInLinkedList(head);
            coderInThirtyDays.DisplayLinkedList(head);
        }