Amazon Interview Question

Given a binary tree with only upwards (parent) node references, re-construct the tree adding in child references. You are given a list of leaf nodes (sorted in left to right order). Tricks include making sure to account for extremely unbalanced trees.

Interview Answers

Anonymous

Apr 27, 2011

Recommend liberal use of queues

Anonymous

Nov 2, 2011

Can use a layer-by-layer recursive method.

Anonymous

May 1, 2011

Can you elaborate pls..