convert an array to a binary tree sample input 1 2 3 4 5 null 6 7 null null null null 8 note if a tree has n nodes and is complete then the no of internal nodes can be n1 2
class Node:

    def __init__(self, val):
        self.val = val
        self.left = None
        self.right = None


def create_tree(arr):
    curr_ptr = 0
    child_ptr = 0

    root = Node(arr[0])
    curr_node = root

    while i < (len(arr) - 1)/2:
        curr_ptr = arr[i]
        child_ptr = i + 1

        left_child = arr[child_ptr]
        right_child = arr[child_ptr + 1]
        
        curr_node.left = Node(left_child)
        curr_node.right = Node(right_child)