Pergunta de entrevista da empresa Amazon

Code to get the depth of a binary tree.

Respostas da entrevista

Sigiloso

7 de set. de 2011

int depth(node * root) { if (root == null) return 0; return max(depth(root->left), depth(root->right) + 1; }

Sigiloso

8 de jul. de 2011

should be easy if you have done it before.