Skip to content
Snippets Groups Projects
tree.py 928 B
Newer Older
  • Learn to ignore specific revisions
  • import sys
    
    class TreeNode(object): 
        def __init__(self, x): 
            # TODO: 3 lines missing.
            raise NotImplementedError("Insert your solution and remove this error.")
    
    #!s=a
    def sorted_array_to_bst(nums):
        # TODO: 4 lines missing.
        raise NotImplementedError("Your stuff here")
        node.left = sorted_array_to_bst(nums[:mid_val])
        # Solve this problem
        # TODO: 2 lines missing.
        raise NotImplementedError("Here")
    print("hello world asdfasd")
    
    #!o=a
    def preOrder(node):
        if not node: 
            # TODO: 1 lines missing.
            raise NotImplementedError("Implement function body")
        print(node.val)
        preOrder(node.left)
        preOrder(node.right)
    for _ in range(10):
        print("Hello world")
    #!o=a
    a = 234
    
    result = sorted_array_to_bst([1, 2, 3, 4, 5, 6, 7])
    preOrder(result)
    
    #!i=a
    for _ in range(10):
        print("hi")
    #!i=a
    
    #!i=b
    print("hello")
    def myfun(a):
        return a*2
    
    print(myfun(4))
    #!i=b