public List<Integer> inorderTraversal(TreeNode root) { ArrayList<Integer>al=new ArrayList<>(); if (root==null)return al; al.addAll(inorderTraversal(root.left)); al.add(root.val); al.addAll(inorderTraversal(root.right)); return al; }