Two-Dimensional Data Structure Practice Problems
- Write the code required to allocate a ragged 2-D int array such that
the first row has space to store 1 value, the second row can store 2 values,
the third row has space to store 3 values, etc. up until the 50th row which
has space to store 50 values.
- Write a method that takes a reference to a 2-D array of ints and
returns the sum of all the numbers stored in that array.
- Write a method that takes a reference to a 2-D array of ints and
returns a distinct copy of that array.
- Do each of the above again but this time using an ArrayList of
ArrayLists rather than an array of arrays.