Computer Science

What are ragged lists ? How are these different from two dimensional lists ?

Linear Lists

1 Like

Answer

A list that has lists as its elements, with each element-list having a different shape, i.e., a different number of elements, is a ragged list. These are also two dimensional lists but irregular 2D lists. So, the main difference between ragged lists and two-dimensional lists is that ragged lists have inner lists with varying lengths, while two-dimensional lists have inner lists with the same lengths, resulting in a regular structure.

Answered By

1 Like


Related Questions