IBM interview question

populate next right pointer in the tree