Java Array initialization
807603Feb 7 2008 — edited Feb 7 2008I am in a Java class and one of the problems that we have been given as homework is stumping me. It wants us to use a stack containing int triples ( i, j, k ) to initialize n values of an n X n array. The trick is that we can't initialize the array normally ( int[][] A = new int[n][n] ) because we don't want a *O[n^2^]*.
My question is, how can I create an n X n array without setting the initial values to zero and still be able to use it in the program?