Example #1
0
        static void Main(string[] args)
        {
            node mynode = new node("A");

            mynode.next           = new node("1");
            mynode.next.next      = new node("B");
            mynode.next.next.next = new node("2");

            //  Console.WriteLine(mynode.next.next.data); // access
            mynode.print();
            Console.WriteLine("__________________________________________\a");
            mynode.append("C");
            mynode.append("3");
            mynode.print();
        }
Example #2
0
 public void append(object data)
 {
     if (next == null)
     {
         next = new node(data);
     }
     else
     {
         next.append(data);
     }
 }