I have a Text File having following lines
1) 2,3 3,2 4,5
2) 1,3 4,2 6,13
3) 1,2 4,2 5,5
4) 1,5 2,2 3,2 5,4 7,3 6,6
The number of lines of the text file is known (i,e 4). The pair digits (for eg : 2,3) are variable for each line. Whereas the pair digit corresponds to the property.
So, to represent these values i am planning to have an array of linked list of an array.
The reason for this choice of mine is that:
1 : Since i know the number of lines is 4. So it will be an array.
2 : Each line has a variable number of pairs. So, i will have a linked list representation for it.
3 : The pair values each represents a property so i will have an array size two for it. One index for each property.
Considering the above three points, I will have an Array(size 4) of LinkedList of an Array(size 2).
Here is how i have represented this in Java(I am new to Java and i have to confess that i do not know yet if its correct ).
static ArrayList<Integer[]>[] graph = (ArrayList<Integer[]>[]) new ArrayList[200];
Now, considering my above graph variable has been initialized properly can some one tell me how can i populate it with the data. If you have some other advice regarding the initialization or how i have conceptually broken the problem in 3 points please share.