it's not weird, but it's usually bad programming.
C# supports jagged arrays. so if the array array lengths are fixed, you should make use of it instead of using ArrayLists due to type unsafety and excessive runtime overhead.
feelite wrote: it's not weird, but it's usually bad programming. C# supports jagged arrays. so if the array array lengths are fixed, you should make use of it instead of using ArrayLists due to type unsafety and excessive runtime overhead.
Unfortunately the arrays I have are of varying length.
varying length is not a problem, the new opreator will auto-allocate the heap memory for you, e.g.
int[][] jagged = new int[2][];
jagged[0] = new int[len1];jagged[1] = new int[len2];
however, if the array will grow or contract during runtime, then you may have to use arraylist. :(
feelite wrote:from my experience, such a data structure is usually not the optimal choice
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
The <H01<E of variable names in the sample code sure is beri the interesting.