Skip to content

Instantly share code, notes, and snippets.

@sxhmilyoyo
Created May 2, 2018 14:40
Show Gist options
  • Save sxhmilyoyo/4f3c30c35f9039978064d92f822e1397 to your computer and use it in GitHub Desktop.
Save sxhmilyoyo/4f3c30c35f9039978064d92f822e1397 to your computer and use it in GitHub Desktop.
typedef struct tnode{
int flag; //indicate whether the node is a leaf(0: number; 1: variable) or internal node(2: operator)
char *varname; //name of the variable
int val; //value of the expression tree
char *op; //operator branch
struct tnode *left, *right; //left and right node
}tnode;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment