标签:describe bsp des odi data def binary self 所有结点
# -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # 返回对应节点TreeNode def KthNode(self, pRoot, k): # write code here if not pRoot or not k : return res = [] def midTraversal(node): if len(res)>=k or not node : return midTraversal(node.left) res.append(node) midTraversal(node.right) midTraversal(pRoot) if len(res)<k: return return res[k-1]
标签:describe bsp des odi data def binary self 所有结点
原文地址:https://www.cnblogs.com/ansang/p/11907770.html