Ejemplo n.º 1
0
 public TAD Pop()
 {
     if (isEmpty())
     {
         Console.WriteLine("Pilha vazia!");
         throw new Exception();
     }
     else
     {
         TAD valor = topo.getData();
         topo = topo.getNextNoh();
         return(valor);
     }
 }
Ejemplo n.º 2
0
 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();
         }
     }
 }