public void Añadir(int valor) { if (this.raiz != null) { Nodo aux = this.raiz; while (aux.siguiente != null) { aux = aux.siguiente; } aux.siguiente = new Nodo(valor); } else { this.raiz = new Nodo(valor); } numElementos++; }
public Nodo(int valor){ this.valor = valor; siguiente = null; }
public void Borrar() { this.raiz = raiz.siguiente; numElementos--; }