File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Section9ArrayAB/Array IMP Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,18 @@ Jagged Array in Java:
22
33A Jagged Array is a multidimensional array where the rows can have different lengths.
44
5- Unlike a regular 2D array, where each row has the same number of columns, a jagged array allows each row to have a
6- different number of elements.
5+ Unlike a regular 2D array, where each row has the same number of columns,
6+ a jagged array allows each row to have a different number of elements.
77
88Key Points:
99
10- - Declared as an array of arrays.
10+ - Declared as an array of arrays.
1111- Each row can have a different length.
1212- Useful when dealing with data structures like triangular matrices.
1313
1414---
1515
16- Code Example
16+ Code Example:
1717
1818public class JaggedArrayExample {
1919 public static void main(String[] args) {
@@ -45,4 +45,4 @@ When to Use Jagged Arrays?
4545
4646- When each row requires a different number of elements.
4747- Optimizing memory usage when working with uneven datasets.
48- - Storing hierarchical or triangular structures.
48+ - Storing hierarchical or triangular structures.
You can’t perform that action at this time.
0 commit comments