Domanda di colloquio di Tripadvisor

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

Risposte di colloquio

Anonimo

6 apr 2013

Right neighbor may not have the same parent.

Anonimo

18 mag 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?)