Skip to content

Instantly share code, notes, and snippets.

View deepika087's full-sized avatar

Deepika Anand deepika087

View GitHub Profile
@deepika087
deepika087 / GenericMultiListIterator.java
Last active June 11, 2018 15:29
Iterates through (generic) List of List <<a1,a2>, <b1,b2,b3,b4>, <c1,c2,c3,c4,c5,c6,c7>> Generates output a1, b1, c1, a2, b2, c2, b3, c3, b4, c4,c5,c6,c7
package com.expedia.sample;
import java.util.ArrayList;
import java.util.Iterator;
public class MultiListIterator<E> implements Iterator<E> {
private ArrayList<ArrayList<E>> useThisList;
private int numOfList;
private int[] sizeOfEachList;
2 2
4 1
4 3
0 5
2 7
4 3
2 5
0 1
3 3
2 5
2 9
0 8
8 0
4 6
6 4
8 0
0 0
2 2
2 5
8 8
0 2
6 3
0 2
0 2
4 2
7 3
2 3
6 6
8 2
0 3
2 2
4 1
4 3
0 5
2 7
4 3
2 5
0 1
3 3
2 5
0 9
0 8
8 0
4 6
1 4
8 0
0 0
2 2
4 5
8 8