コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Console.WriteLine("Add First:");
            LinkList List = new LinkList();

            List.AddToHead(new Node("Hello"));
            List.AddToHead(new Node("Crazy"));
            List.AddToHead(new Node("World"));
            List.PrintAllNodes();

            Console.WriteLine();
            Node New    = new Node("Lisa");
            Node Search = new Node("World");

            List.AddBefore(New, Search);
            List.AddAfter(new Node("Lisa"), Search);
            List.PrintAllNodes();

            Console.WriteLine();
            Console.WriteLine(List.Includes("Crazy"));

            Console.WriteLine("Add Last:");
            List.Append(new Node("Don't"));
            List.Append(new Node("Be"));
            List.Append(new Node("Last"));
            List.PrintAllNodes();
            Console.ReadLine();
        }