public No retiraPrimeiro() { if (this.vazia()) { throw new Exception ("Erro : Lista vazia"); } Celula aux = this.Primeiro; Celula q = aux.prox; No item = q.item; aux.prox = q.prox; if (aux.prox == null) { this.ultimo = aux; } return(item); }
public No pesquisa(No chave) { if (this.vazia() || chave == null) { return(null); } Celula aux = this.Primeiro; while (aux.prox != null) { if (aux.prox.item.equals(chave)) { return(aux.prox.item); } aux = aux.prox; } return(null); }