Exemplo n.º 1
0
        static public Lista_Enlazad Eliminar(NodoLista Lista, string nombre)
        {
            Lista_Enlazad Aux = new Lista_Enlazad();

            if (Lista.Nombre == nombre)
            {
                Aux.InsertarALaCabeza(Lista.SiguienteNodo);
                return(Aux);
            }
            else
            {
                while (Lista.SiguienteNodo != null)
                {
                    if (Lista.Nombre == nombre)
                    {
                        Aux.InsertarALaCabeza(Lista.SiguienteNodo);
                    }

                    Aux.InsertarALaCabeza(Lista);
                    Lista = Lista.SiguienteNodo;
                }
            }

            return(Aux);
        }