该题看起来就与二叉树的中序遍历有相似之处,所以先写一个中序遍历,改一改就是答案了,如下所示 # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param pRootOfTree TreeNode类 # @return TreeNode类 # class Solution: def Convert(self , pRootOfTree ): if not ...