Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void print_tree(int nivel, node root){
- int i;
- if (root == NULL)
- return;
- for (i = 0; i<nivel; ++i){
- printf("..");
- }
- if (root->child == NULL){
- if (root->val != NULL && strcmp(root->val,empty)!=0){
- printf("%s(%s)\n",root->type, root->val);
- }
- else{
- printf("%s\n",root->type);
- }
- return;
- }
- printf("%s\n", root->type);
- while (root->child != NULL){
- print_tree(nivel+1,root->child->child);
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement