+ 2
Jagged array
what is the use of jagged array?
6 Answers
+ 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
+ 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.
+ 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
+ 1
C# 7 is being updated to include mutable tuples. Look up how to use those. Jagged arrays are ugly and seldom used.
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.