public ArrayList<Integer> inorderTraversal_lint(TreeNode root) {
        // write your code here
        ArrayList<Integer> res = new ArrayList<Integer>();
        if (root == null)
            return res;
        Stack<TreeNode> stack = new Stack<TreeNode>();
        TreeNode prev = root;
        while (!stack.isEmpty() || prev != null) {
            while (prev != null) {
                stack.push(prev);
                prev = prev.left;
            }
            prev = stack.pop();
            res.add(prev.val);
            prev = prev.right;
        }
        return res;
    }