數組生成二叉樹python代碼-層序遍歷-適用於測試用例的生成

class Solution(object): def genTree(self, arr): def gen(arr, i): if i < len(arr): tn = TreeNode(arr[i]) if arr[i] is not None else None if tn is
相關文章
相關標籤/搜索