ArrayList<Integer>[] paths = new ArrayList[N];
This line is part of a code given to me in an Assignment to use as part of Djikstra's algorithm.
Since it was given to me in the assignment I assume it's syntactically correct but I don't think I've ever seen an ArrayList being declared with the brackets used to declare Arrays.
Is this an ArrayList or an Array? What do the brackets mean in this case?
ArrayLists.new ArrayList<T>is valid, butnew T[0]isn't.Integer[][]is easy to read andArrayList<ArrayList<Integer>>is easy to read, but that is just confusing at first glance.