Posts

Showing posts with the label Implementation of Code optimization

Implementation of Code optimization

//c code for illustrating Code optimization #include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> struct TAC { char res[5]; char op[2]; char arg1[5]; char arg2[5]; }quad[10]; struct ref { char * id; int label; struct node *ptr; }ref[10]; int cnt=0; int n; typedef struct node { struct node *left; struct node *right; char * val; char arg1[10]; char arg2[10]; char lable1; char label2; }node; struct node *nptr; struct node *ptr; void printtree(); node * mknode(node *left,node *right,char *val,char *arg1,char *arg2,char l1,char l2); int search(char*); void main() { int i,sres; printf("Enter how many TAC"); scanf("%d",&n); for(i=0;i<n;i++) { printf("Enter res"); scanf("%s",quad[i].res); printf("Enter op"); scanf("%s",quad[i].op); printf("Enter arg1"); scanf("%s",quad[i].arg1); printf("Enter arg2...