[자료구조] 중위표현->후위표현
- 최초 등록일
- 2004.05.17
- 최종 저작일
- 2004.05
- 7페이지/ 압축파일
- 가격 1,500원
소개글
C언어로 중위 표현을 후위 표현으로 구현
컴파일 실행환경
총 7파일
postfix.exe
postfix.cpp
postfix.dsp
postfix.dsw
postfix.ncb
postfix.opt
postfix.plg
본문내용
#include<stdio.h>
#include<conio.h>
#define MAX 100
typedef enum {lparen, rparen, plus, minus, times,
divide, mod, eos, operand}preccedence;
preccedence stack[MAX];
preccedence node;
static int isp[]={0, 19, 12, 12, 13, 13, 13, 0};
static int icp[]={20, 19, 12, 12, 13, 13, 13, 0};
int top;
char expr[MAX]="a/b-c+d*e-a*c "; //입력문자열
void add(int *top, preccedence token){ //삽입
if (*top>=MAX-1){
printf("Stack overflow!!\tDelete old data\n");
return;
}
stack[++*top]=token;
}
preccedence del(int *top )
{ //삭제
return stack[(*top)--];
}
void print_token(preccedence node)
{ //화면 출력
압축파일 내 파일목록
postfix.cpp
postfix.dsp
postfix.dsw
postfix.ncb
postfix.opt
postfix.plg
Debug/postfix.exe
참고 자료
C언어로 구현한 자료구조