Algoritmo metodo de int- y post

Páginas: 2 (297 palabras) Publicado: 27 de febrero de 2010
include include char _[4][3]={{'(',')','0'},{'-','+','0'},{'/','*','0'},{'^','0','0'}};
void __(char [],int ),
_(char [],char []),
RecPos(char []),
Conv_Pos(char [],char []),Iver(char []),
RePre(char []),
Entrada(char []),
Conv(char [],char []);
int Prio(char,char),
length(char []);
typedef enum {False,True} bool;
Par Cadena(char []);
boolIfcaracter(char);
int main()
{
char Dato[50],Ax[50],Aw[50],POSTE[50],PREOR[50];
__(POSTE,50);
__(Ax,50);
__(Aw,50);
do{
printf("%s","Ingrese la expresion infija que desea evaluar: ");Entrada(Dato);
if(Cadena(Dato)!=igual)
{
printf("La expresion ingresada '%s' no es valida",Dato);
switch(Cadena(Dato))
{
case izq:printf(" Le faltan parentesis derechos a laExpresion.");break;
case der:printf(" le faltan parentesis izquierdos a la Expresion.");break;
case none:printf(" ya que no es funci¢n valida a la Expresion.");break;
}
getchar();
}}while(Cadena(Dato)!=igual);
_(Ax,Dato);
_(Aw,Dato);
Iver(PREOR);
Conv_Pos(Aw,POSTE);
printf("%s %sn","La conversion a Postfijo es: ",POSTE);
getch();
}
void Conv_Pos(char EI[],charPOSTE[])
{
__(PILA,50);
TOPE=-1;
n=length(EI);
Simbolo=EI[0];
RecPos(EI);
n-=1;
if(Simbolo=='(')
}
else
if(Simbolo==')')
{
while(PILA[TOPE]!='(')
{agregar(POSTE,PILA[TOPE]);
PILA[TOPE]='0';
TOPE-=1;
}
PILA[TOPE]='0';
TOPE-=1;
}
agregar(POSTE,Simbolo);
}else
{
if(length(PILA)>0)
{
while(Prio(Simbolo,PILA[TOPE])=0)
{agregar(POSTE,PILA[TOPE]);
TOPE-=1;
}
}
void __(char Text[],int n)
{
}
void Entrada(char Dato[])
{
}
int length(char text[])
{
}
void _(char A[],char B[])
{}
Par Cadena(char text[])
{
Par val=none;
n=length(text);
PILA[TOPE]=elem;
TOPE+=1;
PILA[TOPE]='0';
}else
TOPE-=1;
PILA[TOPE]='0';
}
}
void Iver(char Expr[])...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Metodo Post
  • Metodo Post
  • Programacion Algoritmos Pse Int
  • metodos y tecnicas de post alfabetizacion
  • Algoritmos Metodo Fridich
  • Algoritmo Metodo simplex
  • Algoritmo de metodo simplex
  • MÉTODO DE ALGORITMOS GENÉTICOS

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS