def inorder_traversal_iterative(root):
    """
    Return the inorder traversal of nodes' values.

    - Worst Time complexity: O(n)
    - Worst Space complexity: O(n)

    :param root: root node of given binary tree
    :type root: TreeNode or None
    :return: inorder traversal of nodes' values
    :rtype: list[int]
    """
    # basic case
    if root is None:
        return []

    # use stack to traverse
    result = []
    stack = []
    while root is not None or len(stack) != 0:
        # put left nodes into stack
        if root is not None:
            stack.append(root)
            root = root.left
        # bottom-up to traverse
        else:
            root = stack.pop()
            result.append(root.val)
            root = root.right

    return result