+ 2

Jagged array

what is the use of jagged array?

26th Jul 2016, 11:41 AM
Faheem Patil
Faheem Patil - avatar
5 Réponses
+ 2
Hi Faheem. You can use to put an array into other array. For example an array of days into an array of months into an array of years.I hope it helps
26th Jul 2016, 10:02 PM
Ricardo Pucca
Ricardo Pucca - avatar
+ 2
Even if they are slower to allocate. they are easier and faster to index, and use less memory. I used them to make the "pascal triangle" thing. and In a game I am thinking of using them to store the individual inventory of a character group. It all depends on your imagination, there is more than one way to solve a problem, the only difference is that some of them are easier than others.
28th Jul 2016, 5:42 AM
Julio González
Julio González - avatar
+ 1
ya even i think that in most of the cases jagged array is not much useful but as they have specified in the concept want to know in which cases it is used which type of programs n all
27th Jul 2016, 4:36 PM
Faheem Patil
Faheem Patil - avatar
+ 1
C# 7 is being updated to include mutable tuples. Look up how to use those. Jagged arrays are ugly and seldom used.
31st Jul 2016, 1:08 PM
Mike
Mike - avatar
0
my point of view is that it's not very useful. most of the time, using dictionaries or lists is much more intuitive. but I think that arrays are more lighter in memory and in some cases, depending on what you have to do, it could be very useful.
27th Jul 2016, 4:33 PM
Yoann Melchior
Yoann Melchior - avatar