How to split array list into equal parts?

前端 未结 9 1288
攒了一身酷
攒了一身酷 2020-11-29 07:20

Is there anyway to split ArrayList into different parts without knowing size of it until runtime? I know there is a method called:

list.subList(a,b);
         


        
9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 08:12

    If you're constrained by PL/SQL in limits then you want to know how to split a list into chunks of size <=n, where n is the limit. This is a much simpler problem as it does not require knowing the size of the list in advance.

    Pseudocode:

    for (int n=0; n

提交回复
热议问题