```
class Solution:
# @param {TreeNode} root
# @return {integer[]}
def inorderTraversal(self, root):
if not root:
return []
stack = []
queue = []
stack = self.getleft(root)
while stack:
node = stack.pop()
if node:
queue.append(node.val)
stack.extend(self.getleft(node.right))
return queue
def getleft(self,root):
s = []
while root:
s.append(root)
root = root.left
return s
```