I first ran into my problem trying to create a int[][] of very large size (7k by 30k) for a dictionary gap list postings program. But alas I run out of space trying to allocate the array. How might I create a 2-d array of integers?
What I want is a list of list in which each list in the list is a list of integers. Here is a sample of my code.
Code:
static final int numberOfTerms = 6782;
static final int numberOfLines = 30383;
byte[][] countMatrix = new byte[numberOfLines][numberOfTerms];
int[][] gapsMatrix = new int[numberOfLines][numberOfTerms]; // To big!!
This list of lists is going to be filled with integers that represent the gaps between two occurrences of the same word in a specific text. So in count matrix I hold a byte indicating whether a word is specified for a specified index. Then in the function I am creating right now I am going through the countMatrix and if I find a byte there, I take the current index minus the last found index and save that number in my 2D-array of integers which gives me the just the gaps between each of the same word in the text.
So how might I create a data structure I need to accomplish this?