Problem Link: http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/ Just traverse the tree from the root, level by level. Esay enough. # Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val =…