What is the difference between ragged and jagged arrays? As per my research both have the same definitions, i.e. two-dimensional arrays with different column lengths.
Ragged array: is an array with more than one dimension each dimension has different size
ex:
10 20 30
11 22 22 33 44
77 88
Jagged array: an array where each item in the array is another array. C# Code:
int[][] jaggedArray = new int[3][];
jaggedArray[0] = new int[5];
jaggedArray[1] = new int[4];
jaggedArray[2] = new int[2];