コード例 #1
0
        static void Main(string[] args)
        {
            Node head = null;

            LinkedList.Append(ref head, 001);
            LinkedList.Append(ref head, 002);
            LinkedList.Append(ref head, 003);
            LinkedList.Append(ref head, 004);

            Console.WriteLine("Linked list:");
            LinkedList.Print(head);

            LinkedList.Reverse(ref head);

            Console.WriteLine();
            Console.WriteLine("Reversed Linked list:");
            LinkedList.Print(head);

            Console.WriteLine();
            //LinkedList.PrintRecursive(head);

            Console.WriteLine("Reverse of Reversed Linked list:");


            LinkedList.ReverseUsingRecursion(head);
            head = LinkedList.newHead;
            LinkedList.PrintRecursive(head);

            Console.ReadKey();
        }