protected void btnTopo_Click(object sender, EventArgs e)
 {
     ltrMsg.Text = "";
     if ((Session["INSERCAO"] != null) && (pilhaPalavras.Count() != 0))
     {
         ltrDados.Text = Pilha.Topo(pilhaPalavras);
     }
 }
Beispiel #2
0
        private bool VerificarOrdem(Pilha <char> parenteses)
        {
            if (parenteses.Topo() == '(')
            {
                return(false);
            }

            int control = 0;

            while (!parenteses.EstaVazia())
            {
                if (parenteses.Desempilhar() == ')')
                {
                    control++;
                    continue;
                }
                control--;
            }
            return(control == 0 && parenteses.Tamanho % 2 == 0);
        }