public static void main(String args[]){
        Integer arr1[] = {1,5,6,9,21};
        Integer arr2[] = {4,6,11,14};
        Integer arr3[] = {-1,0,7};
        Integer arr4[] = {-4,-2,11,14,18};
        Integer arr5[] = {2,6};
        Integer arr6[] = {-5,-2,1,5,7,11,14};
        Integer arr7[] = {-6,-1,0,15,17,22,24};
        
        List<Integer> list1 = Arrays.asList(arr1);
        List<Integer> list2 = Arrays.asList(arr2);
        List<Integer> list3 = Arrays.asList(arr3);
        List<Integer> list4 = Arrays.asList(arr4);
        List<Integer> list5 = Arrays.asList(arr5);
        List<Integer> list6 = Arrays.asList(arr6);
        List<Integer> list7 = Arrays.asList(arr7);
        
        
        List<List<Integer>> chunks = new ArrayList<List<Integer>>();
        chunks.add(list1);
        chunks.add(list2);
        chunks.add(list3);
        chunks.add(list4);
        chunks.add(list5);
        chunks.add(list6);
        chunks.add(list7);
        
        ChunkMerge cm = new ChunkMerge();
        List<Integer> result = cm.mergeChunksOfDifferentSize(chunks);
        System.out.println(result.size());
        for(Integer r : result){
            System.out.print(r + " ");
        }
        
        result = cm.mergeUsingHeap(chunks);
        System.out.println();
        for(Integer r : result){
            System.out.print(r + " ");
        }
    }
If chunks are of equal size then
i = size*start to (mid+1)*size -1
j = (mid+1)*size to size*(end+1)
src/com/interview/array/ChunkMerge.java