Exemplo n.º 1
0
        static void Main(string[] args)
        {
            LinkedList ll = new LinkedList();

            NodeString toAdd = new NodeString("first");
            ll.AddNode(toAdd);
            toAdd = new NodeString("2nd");
            ll.AddNode(toAdd);
            toAdd = new NodeString("third");
            ll.AddToBack(toAdd);
            toAdd = new NodeString("4th");
            ll.AddAt(2, toAdd);
            toAdd = new NodeString("5th");
            ll.AddAt(7, toAdd);
            Console.WriteLine(ll.ToString());
            ll.Delete();
            ll.DeleteAt(8);
            ll.DeleteFromEnd();

            Console.WriteLine(ll.ToString());
            Console.WriteLine("");
            Console.WriteLine("======End of Program======");
        }
Exemplo n.º 2
0
        public BookList(string bookName)
        {
            Books = new LinkedList <string>();

            Books.AddFirst(new LinkedListNode <string>(bookName));
        }
Exemplo n.º 3
0
 public BookList(LinkedList <string> books)
 {
     Books = books;
 }
Exemplo n.º 4
0
 public BookList()
 {
     Books = new LinkedList <string>();
 }