def _traverse_node(tree, node, maxsize, totcolcnt):
    stack = []
    node_list = []
    curr = node

    def _walk(node: int, side: int):
        child = int(tree[node][side])
        child_size = 1
        idx = 0
        if (child > totcolcnt):
            idx = (child - totcolcnt)
            child_size = tree[idx][3]
        if (child_size > maxsize):
            return idx
        else:
            node_list.append(_get_leaves(tree, child, totcolcnt))
            return None
    while True:
        if (curr is not None):
            stack.append(curr)
            curr = _walk(curr, LEFT)
        elif stack:
            curr = stack.pop()
            curr = _walk(curr, RIGHT)
        else:
            break
    return node_list
def _traverse_node(tree, node, maxsize, totcolcnt):
    stack = []
    node_list = []
    curr = node

    def _walk(node: int, side: int):
        child = int(tree[node][side])
        child_size = 1
        idx = 0
        if (child > totcolcnt):
            idx = (child - totcolcnt)
            child_size = tree[idx][3]
        if (child_size > maxsize):
            return idx
        else:
            node_list.append(_get_leaves(tree, child, totcolcnt))
            return None
    while True:
        if (curr is not None):
            stack.append(curr)
            curr = _walk(curr, LEFT)
        elif stack:
            curr = stack.pop()
            curr = _walk(curr, RIGHT)
        else:
            break
    return node_list