Skip to Content
C# 7 and .NET Core 2.0 High Performance
book

C# 7 and .NET Core 2.0 High Performance

by Ovais Mehboob Ahmed Khan
April 2018
Intermediate to advanced
300 pages
7h 41m
English
Packt Publishing
Content preview from C# 7 and .NET Core 2.0 High Performance

Arrays

An array is a collection that holds similar types of elements. Arrays of both value types and reference types can be created.

Here are few circumstances where arrays are useful:

  • If the data is of a fixed, set length, using an array is a better option as it is faster than other collections, such as arraylists and generic lists
  • Arrays are good to represent data in a multidimensional way
  • They take less memory compared to other collections
  • With arrays, we can iterate through elements sequentially

The following table shows the Big O notation for each operation that can be performed in an array:

Operations

Big O notation

Access by Index

O(1)

Search

O(n)

Insert at the end

O(n)

Remove at the end

O(n)

Insert ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional C# 7 and .NET Core 2.0, 7th Edition

Professional C# 7 and .NET Core 2.0, 7th Edition

Christian Nagel
Pro ASP.NET Web API: HTTP Web Services in ASP.NET

Pro ASP.NET Web API: HTTP Web Services in ASP.NET

Tugberk Ugurlu, Alexander Zeitler, Ali Kheyrollahi
Enterprise Application Development with C# 9 and .NET 5

Enterprise Application Development with C# 9 and .NET 5

Ravindra Akella, Rishabh Verma, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu

Publisher Resources

ISBN: 9781788470049Supplemental Content