```
class Solution:
# @param {TreeNode} root
# @return {integer[]}
def inorderTraversal(self, root):
if root is None: return []
results = []
stack = []
stack.append((False, root))
while stack:
(visited_left, node) = stack.pop()
if not visited_left:
# now this node has gone to left
stack.append((True, node))
if node.left:
stack.append((False, node.left))
else:
# We are done with the left side
# read the data
# go right
results.append(node.val)
if node.right:
stack.append((False, node.right))
return results
```