Tested in Code Blocks! When traced works fine...but when run hangs!!! Some problem in the function Build_Suf_Tree... Please help anyone!Code:#include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct SUF_TREE { char *edge_label; struct SUF_TREE *child1; struct SUF_TREE *child2; struct SUF_TREE *child3; struct SUF_TREE *child4; struct SUF_TREE *child5; struct SUF_TREE *child6; }*suf_tr; suf_tr Build_Suf_Tree(char *str,unsigned str_len) { unsigned loop1,loop2; suf_tr ROOT; ROOT = (suf_tr)calloc(1,sizeof(struct SUF_TREE)); for(unsigned suf_no = 0; suf_no < str_len; suf_no++) { char *temp_str = (char*)calloc(str_len - suf_no + 1,sizeof(char)); for(loop1 = suf_no, loop2 = 0; loop1 <= str_len + 1; loop1++, loop2++) temp_str[loop2] = str[loop1]; temp_str[loop2+1] = '\0'; suf_tr new_node = (suf_tr)calloc(1,sizeof(struct SUF_TREE)); //new_node->edge_label = (char*)calloc(str_len - suf_no + 1,sizeof(char)); //strcpy(new_node -> edge_label,temp_str); //puts(temp_str); printf(temp_str); //free(temp_str); //free(new_node); //puts(new_node -> edge_label); free(temp_str); } //return ROOT; } int main() { unsigned str_len=7; char *str; suf_tr ROOT; //printf("Enter the length of the string : "); //scanf("%u",&str_len); str = (char*)calloc(str_len+1,sizeof(char)); fflush(stdin); //printf("Enter the string : "); //scanf("%s",str); str = "anirban$"; //str[str_len]= '$'; str[str_len+1] = '\0'; //puts(str); ROOT = Build_Suf_Tree(str,str_len); return EXIT_SUCCESS; }