Node*constructie() { Node*p; char c; //printf("\nnume nod"); scanf("%c",&c); if (c=='*') return 0; else { p=(Node*)malloc(sizeof(Node)); p->key=c; p->left=constructie(); p->right=constructie(); } return p; }
void functie(char*cuv, radix*rad) { int ok = 0; int i = 0; radix*fin = NULL, *aux = NULL; fin = gasire_pointer(rad, cuv[i], ok); aux = fin; while (ok != 1) { i++; aux = fin; fin = gasire_pointer(fin, cuv[i], ok); } constructie(aux, cuv, i); }
int main() { //FILE*f=fopen("data.txt","r"); //FILE*g=fopen("out.txt","w"); Node*rad=constructie(); printf("\npreordine\n"); preorder(rad,0); printf("\ninordine\n"); inorder(rad,0); printf("\npostorder\n"); postorder(rad,0); //fclose(f); //fclose(g); return 0; }