Exemplo n.º 1
0
    public static void Main()
    {
        try
        {
            LinkedList list = new LinkedList();

            Console.WriteLine("It is {0} that this list in empty", list.IsEmpty());

            list.Insert("Happy days");
            list.Insert("Pie in the sky");
            list.Insert("Trouble in River City");

            Console.WriteLine("The original list is:");

            list.Display();
            list.Reset();
            list.Advance();

            Console.WriteLine("The current list element is {0}", list.GetData());

            list.Remove();

            Console.WriteLine("The list, after removing the current element, is:");

            list.Display();

        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
        Console.WriteLine("Hit any key to exit");
        Console.ReadLine();
    }