I have an List implemented ArrayList having large number of indices. I would like to parition it into separate ArrayList. I have done as
List<List<Integer>> list = new ArrayList<List<Integer>>(10000000);
List<List<Integer>> sublist1 = list.subList(0,x)
List<List<Integer>> sublist2 = list.subList(x,y)
and so on.I don't know if it is the correct way of partitioning. Could you please suggest me an efficient way of partitioning?
[EDIT]
I have an arrayList of something like this:
[[1,2,3],[4,5,6],[8,9,10],[11,12,13],[44,88,1000], ......,[54,23,53]]
This list is very long.I would like to get subList such as of some small size from the above list.Each of the list will contain non-overlapping inside list:
sublist1:[[1,2,3][4,5,6] ...[.,.,.]] sublist2:[[,,,][] .... [,,,,]] sublistn:[[,,,][,,,]....[54,23,53]]
[EDIT]
Please do not get confuse that []
is null list.I wanted to show the number of lists inside a list.