Pergunta de entrevista da empresa Tripadvisor

Given a binary search tree, set up a variable in each node that points to its right neighbor.

Respostas da entrevista

Sigiloso

6 de abr. de 2013

Right neighbor may not have the same parent.

Sigiloso

18 de mai. de 2013

Would you mind elaborate the question a bit? Is it about finding the nearest node on the right hand-side? (So, its right sibling would be the first choice, but if none exists, move up one level and keep looking, somehting like that?)