Microsoft interview question

I was asked to populate the next right pointer in a binary tree.

Interview Answer

Anonymous

6 Nov 2019

First I used queues but was asked to further optimize it such that it consumes O(1) extra space. Was asked to write the codes for both of them.