18.04.2013 Views

ESTRUTURAS DE DADOS B´ASICAS EM JAVA

ESTRUTURAS DE DADOS B´ASICAS EM JAVA

ESTRUTURAS DE DADOS B´ASICAS EM JAVA

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

✬ ✩<br />

Estruturas de Dados Básicas em Java<br />

public Object topo() throws<br />

StackEmptyException {<br />

if (vazia())<br />

}<br />

throw new StackEmptyException(‘‘Pilha<br />

está vazia.’’);<br />

return topo.retItem();<br />

public Object desempilha() throws<br />

StackEmptyException {<br />

if (vazia())<br />

}<br />

throw new StackEmptyException(‘‘Pilha<br />

está vazia.’’);<br />

Object aux = topo.retItem();<br />

topo = topo.retProx; // aponta para o<br />

// próximo nó<br />

tam--;<br />

return aux;<br />

}<br />

José de Siqueira 13<br />

✫ ✪

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!