Pergunta de entrevista da empresa Amazon

Binary Tree - Common Ancestor of two nodes

Respostas da entrevista

Sigiloso

8 de jul. de 2014

his solution is log(n) (balanced tree) and very intuitive and simple.

1

Sigiloso

15 de mai. de 2014

Find path to each of the two nodes and load both paths into the arraylist. Loop over arraylists and find the common nodes in the path. Pick the last common node.

1

Sigiloso

15 de jun. de 2014

this is to much extensive..you should use a recursive solution.