Populate next pointers in a perfect binary tree | Microsoft Interview Question