Pergunta de entrevista da empresa Splunk

How would you print the nodes in a tree using DFS?

Resposta da entrevista

Sigiloso

23 de fev. de 2014

void dfs(struct node *root) { if(root == null) { return; } else { dfs(root->left); printf("element: %d",root->data ); dfs(root->right); } }