https://leetcode-cn.com/problems/binary-tree-inorder-traversal/
中序遍历: 左根右
public List<Integer> inorderTraversal(TreeNode root) {
List<Integer> list = new ArrayList<>();
inorder(root, list);
return list;
}
public void inorder(TreeNode root, List<Integer> list) {
if (root == null) {
return;
}
inorder(root.left,list);
list.add(root.val);
inorder(root.right, list);
}