Ragged and Jagged Arrays

前端 未结 4 1828
情书的邮戳
情书的邮戳 2021-02-07 12:42

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.

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 13:34

    Jagged array is array of arrays such that member arrays can be of different sizes, i.e., we can create a 2-D arrays but with variable number of columns in each row. These type of arrays are also known as ragged arrays.

    Contents of 2D Jagged Array
    0 
    1 2 
    3 4 5 
    6 7 8 9 
    10 11 12 13 14 
    

    http://www.geeksforgeeks.org/jagged-array-in-java/

提交回复
热议问题