How would you print the nodes in a tree using DFS?
Anonymous
void dfs(struct node *root) { if(root == null) { return; } else { dfs(root->left); printf("element: %d",root->data ); dfs(root->right); } }
Check out your Company Bowl for anonymous work chats.