Esempio n. 1
0
def run():
    ns = Solution()
    from common import CommonUtil
    root = None
    root = CommonUtil.generateTree(root)
    CommonUtil.printTree(root)
    print ns.countNodes(root)
Esempio n. 2
0
def run():
    ns = Solution()
    from common import CommonUtil
    root = None
    root = CommonUtil.generateTree(root)
    CommonUtil.printTree(root)
    print ns.countNodes(root)
Esempio n. 3
0
def run():
    from common import CommonUtil
    root = None
    root = CommonUtil.generateTree(root)
    CommonUtil.printTree(root, 0)
    ns = Solution()
    ret = ns.pathSum(root, 17)
    print ret
Esempio n. 4
0
def run():
    from common import CommonUtil
    root = None
    root = CommonUtil.generateTree(root)
    CommonUtil.printTree(root , 0)
    ns = Solution()
    ret = ns.hasPathSum(root , 17)
    print ret
Esempio n. 5
0
def run():
    from common import CommonUtil
    root = None
    root = CommonUtil.generateTree(root)
    CommonUtil.printTree(root , 0)
    ns = Solution()
    ret = ns.binaryTreePaths(root)
    print ret