Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
C# Data Structures and Algorithms

You're reading from  C# Data Structures and Algorithms

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788833738
Pages 292 pages
Edition 1st Edition
Languages
Author (1):
Marcin Jamro Marcin Jamro
Profile icon Marcin Jamro
Toc

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 add a new item at the end of the array or insert it in a given position within the array. If you need such features, you can use other data structures described in this chapter, such as generic lists.

Note

You can find more information about arrays at https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/.

After this short description...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime