public List<Integer> inorderTraversal2(TreeNode root) {
        List<Integer> rst = new ArrayList<Integer>();
        if(root == null) {
            return rst;
        }
        
        Stack<TreeNode> stack = new Stack<TreeNode>();
        
        TreeNode p = root;
        
        while(!stack.isEmpty() || p != null) {
        
        	if(p != null) {
        		stack.push(p);
        		p = p.left;
        	} else {
        		TreeNode top = stack.pop();
        		rst.add(top.val);
        		p = top.right;
        	}
        }
        
        return rst;
    }