Ejemplo n.º 1
0
        public void run()
        {
            Peanut = Head;
            tail = Fido;
            Peanut.DogName = "Peanut";
            Peanut.DogBreed = "Bichon";
            Peanut.nextDog = fifi;
            Peanut.prevDog = null;

            Fifi.DogName = "fifi";
            Fifi.DogBreed = "poodle";
            Fifi.nextDog = jordan;

            jordan.DogName = "jordan";
            jordan.DogBreed = "germanshepperd";
            jordan.nextDog = Fido;

            Fido.DogName = "fido";
            Fido.DogBreed = "beagle";
            Fido.nextDog = null;

            Fido.DogName = "fifi";
            Fido.DogBreed = "poodle";
            Fido.nextDog = roy;
        }
Ejemplo n.º 2
0
        public void WalkOverTheList()
        {
            current = Head;
            while (current != null)
            {
                Console.WriteLine(current.DogName);
                current = current.nextDog;


            }
        }