1
Never
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> typedef struct Node{ struct Node *left; struct Node *right; char data; }Node; Node *a; void constructTree(Node **head); void printInfix(Node *root); int main() { constructTree(&a); printInfix(a); printf("\n"); } void constructTree(Node **head) { (*head)=(Node*)malloc(sizeof(Node)); char c; c=getchar(); (*head)->data=c; (*head)->right=(*head)->left=NULL; if((*head)->data=='*' ||(*head)->data=='/' || (*head)->data=='+' || (*head)->data=='-' ) { constructTree(&(*head)->left); constructTree(&(*head)->right); } return; } void printInfix(Node *root) { if(root->left!=NULL) { if((root->data=='*'||root->data=='/') && (root->left->data=='+'|| root->left->data=='-'))printf("("); printInfix(root->left); if((root->data=='*'||root->data=='/') && (root->left->data=='+'|| root->left->data=='-'))printf(")"); } printf("%c",root->data); if(root->right!=NULL) { if(((root->data=='*') && (root->right->data=='+'|| root->right->data=='-'))||((root->data=='-')&&((root->right->data=='+')||(root->right->data=='-')))||((root->data=='/') && !isalpha(root->right->data)))printf("("); printInfix(root->right); if(((root->data=='*') && (root->right->data=='+'|| root->right->data=='-'))||((root->data=='-')&&((root->right->data=='+')||(root->right->data=='-')))||((root->data=='/') && !isalpha(root->right->data)))printf(")"); } return; }
Raw Text
-
PORN + JAV
3 min ago
-
dsfds fdsf ds fds
51 min ago
-
11840 - Moving books
C | 1 hour ago
-
LOKAL PR1V4TE 1
1 hour ago
-
3oBVlD K0L.PACK 1
1 hour ago
-
PURE AJAHH 5
1 hour ago
-
MADAM MEGA PECK 5
1 hour ago
-
JOIN GRUP VIP RIBUAN VID & BVRARE JUGAA
1 hour ago
-
fa sdsadf dsfasfdasfdasfda
2 hours ago
-
dfdfds dsffsd fdsdf sdfs fdsfdssfd
3 hours ago