Python solution using stack


#1
def inorderTraversal(self, A):
    t=A
    stack=[]
    inorder=[]
    while(stack !=[] or t!=None):
        if(t!=None):
            stack.append(t)
            t=t.left
        else:
            t=stack.pop()
            inorder.append(t.val)
            t=t.right
    return inorder