public TAD Pop() { if (isEmpty()) { Console.WriteLine("Pilha vazia!"); throw new Exception(); } else { TAD valor = topo.getData(); topo = topo.getNextNoh(); return(valor); } }
public void Print() { if (isEmpty()) { Console.WriteLine("Pilha vazia!"); } else { NohPilha <TAD> n = topo; while (n != null) { Console.WriteLine("\n " + n.getData()); n = n.getNextNoh(); } } }