#include<stdlib.h> #include<stdio.h> #include<string.h> #include<ctype.h> #define MAX_LEN 5 typedef struct node{ char optr; int data; struct node* lchild; struct node* rchild; }BTNode; BTNode * getNode(char *str,int &pos){ BTNode *createTree(char *str,int &pos); BTNode *p=new BTNode; char ch=str[0]; if(isdigit(ch)){ int i=0; char data[MAX_LEN]; while(isdigit(ch=str[i])) data[i++]=ch; p->data=atoi(data); pos+=i; } else if(ch=='+'||ch=='-'||ch=='*'||ch=='/'){ p->optr=ch; pos+=1; } else if(ch=')'){ pos+=1; return NULL; } else if(ch=='