Rows and Columns
We shall create a two-dimensional array where the rows can be of different lengths. Most 2D arrays I have come across have rows that are all the same length. The developers of the Perl language have come up with a 2D array of different row lengths. In our custom array, let us meet this challenge.
The above table shows what we are talking about. The rows are of different lengths. They all begin from the left edge of the array table. With this array, you can talk about the height of the array, which is the number of rows.
But you can't talk about the width of the array, since the rows have different lengths. Note that the word "length" applies more to a one-dimensional quantity than to a two-dimensional one. You can talk about a maximum row length or even a minimum row length.
The rows of the array that we shall deal with in this series all begin from the left edge of the array table. The height of the array is the number of rows.