Example #1
0
        public void Run()
        {
            /* Create linked list */
            int[]          vals  = { -1, -2, 0, 1, 2, 3, 4, 5, 6, 7, 8 };
            LinkedListNode list1 = AssortedMethods.CreateLinkedListFromArray(vals);

            int[]          vals2 = { 12, 14, 15 };
            LinkedListNode list2 = AssortedMethods.CreateLinkedListFromArray(vals2);

            list2.Next.Next = list1.Next.Next.Next.Next;

            Console.WriteLine(list1.PrintForward());
            Console.WriteLine(list2.PrintForward());

            LinkedListNode intersection = findIntersection(list1, list2);

            Console.WriteLine(intersection.PrintForward());
        }