Member-only story

Data Structures and Algorithms (DSA) using C# .NET Core — Linear and Non-Linear Data Structures

Hussain Patel
2 min readNov 4, 2024

--

In this series of notes, we would be discussing about implementing and developing Data Structures using C#. These data structures are found in the .NET core framework class library System.Collection.

What is a Collection?, Let understand this first, A Collection is a data structure that stores data and provides operations for adding, removing, updating, searching etc. Collection can be broken into two types — Linear and Non-Linear.

Linear Collection — In linear collection the elements are placed in such a way that one element follows previous element. Elements in a linear collection are normally ordered by position. e.g. Arrays, Strings, Struct

Non-Linear Collection — In non-linear collection element do not hold or have any positional order, e.g. Organizational Chart, Trees, Heap, Graphs and Sets.

Note: Both linear and non-linear collections have a defined set of properties and operations that they can perform on the elements. example count property and operations like — Add, Insert, Remove, Contains, IndexOf etc.

Each Category has many sub-categories, lets understand each of them.

Linear collections can be either direct access or sequential access collections. Non-linear collections can be hierarchical or grouped collections.

Direct Access Collection: Array, strings & struct are examples of direct access collection. An array is a collection of elements of same data type and can be accessed using index. A string is a collection of characters that can be accessed using index. An Struct ( or structures) is a composite data type that holds data of different data types.

Sequential Access Collection:

--

--

Hussain Patel
Hussain Patel

Written by Hussain Patel

Husband, Father , @theWorkingProgrammer, IOT, Photography

No responses yet