Java Easy and Simple Recursive Solution


#1
public class Solution {
ArrayList<Integer> list=new ArrayList<>();
public ArrayList<Integer> inorderTraversal(TreeNode root) {
    inorder(root);
    return list;
}
public void inorder(TreeNode root)
{
    if(root==null)return;
    inorder(root.left);
    list.add(root.val);
    inorder(root.right);
}

}