Typedef Struct Char Struct: #Include #Include
Typedef Struct Char Struct: #Include #Include
h>
#include <stdlib.h>
node *root;
node *stack[10];
int top;
node *pop();
void push( node * );
int main(void)
{
root = NULL;
top = -1;
int i = 0;
char ch;
while( (ch = postfix[i]) != '\0' )
{
if ( ch == '/' || ch == '*' || ch == '-'|| ch == '+' )
{
operatorNode( ch );
}
else
{
operandNode( ch );
}
i++;
}
root = pop();
printf( "PREORDER : " );
preOrder( root );
printf( "\n" );
newNode->data = ch;
pr = pop();
pl = pop();
newNode->left = pl;
newNode->right = pr;
push( newNode );
}
if ( ptr->right != NULL )
{
inOrder( ptr->right );
}
return;
}
return;
}