Arrays

Let's start with the array data structure. You can use it to store many variables of the same type, such as int, string, or a user-defined class. As mentioned in the introduction, while developing applications in the C# language, you can benefit from a few variants of arrays, as presented in the following diagram. You have access not only to single-dimensional arrays (indicated as a), but also multi-dimensional (b), and jagged (c). Examples of all of them are shown in the following diagram:

What is important is that the number of elements in an array cannot be changed after initialization. For this reason, you will not be able to easily ...

Get C# Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.