Can anyone tell me What does jagged array do? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone tell me What does jagged array do?

I think that it's act like a 2D array, is it true?

3rd Mar 2017, 9:47 PM
Mahmoud Salama
Mahmoud Salama - avatar
1 Answer
+ 2
it is, but its unique in that the second dimension can have a varying quantity of keys. example i[4][] is the array i[0][3] can be the first array i[1][5] is second i[2][1] is third and i[3][7] is fourth a visual example could be i is a mother (key) with a name (value). each mother has a different amount of children (key) with their own names (value). that's probably the easiest way i can think of describing a jagged array
6th Mar 2017, 10:36 AM
William La Flamme
William La Flamme - avatar