What is Data Structure?
Data Structure is a specific way to organize and store data in computer memory.
It is important to choose the right Data Structure for your project. For example, if you want to store data sequentially in the memory then you need to use one of the type’s Linear Data Structure.
Data Structure Types
The Data Structure has two types:
 Linear Data Structure.
 NonLinear Data Structure.
And each type has its once types and the diagram below explains the types of Linear and NonLinear.
1) Linear Data Structure
A Linear Data Structure can store the data linearly or sequentially in the memory.
It includes the data at a single level such that we can traverse all data into a single run.
The implementation of Linear Data Structure is easier as the elements are sequentially organized in memory.
Types of Linear Data Structure
There are four types of linear data structure:
 Array.
 Linked list.
 Stack.
 Queue.
Array: is a collection of items stored in memory. The idea is to store multiple items of the same type together. And you can access a random element in the array.
Also read: How to use Array in c#.
Liked list: is a sequence of links that contain items. Each contains a connection to another link.
Also read: How to use Linked List in C#.
Stack: follows a particular order named LIFO stands for LastInFirstOut which means the last item in the list is the first item to out. And it’s an abstract data type with a predefined capacity.
Also read: How to use Stack in C#.
Queue: is similar to a Queue in the real world. In which whatever comes first will go out first, and it follows the FIFO (FirstInFirstOut) policy.
Also read: What is Queue and How to use it in C#.
2) NonLinear Data Structure
A NonLinear Data Structure is a data that is connected to its previous, next, and more elements like a complex structure. In simple terms, data is not organized sequentially.
 There are multiple levels into NonLinear Data Structure and also called a multilevel data structure.
 We can’t implement NonLinear Data Structures as easily as linear data structures.
Types of NonLinear Data Structure
There are two types of NonLinear Data Structure:
 Tree
 Graph
Tree: it represents the nodes connected by edges, node it’s like an item or element in an Array which contains data.
Also, read Tree in Data Structure using C#.
Graph: it is a collection of vertices that are connected to other vertices by edges.
Also read: How to use Graph and BFS in C#.
Linear Data Structure vs NonLinear Data Structure
Key

Linear Data Structure

NonLinear Data Structure

Traversal

Can be traversed in a single run.

Can’t be traversed in a single run.

Levels

Single level

Multilevel

elements connection

Only to its previous and next elements.

The element can connect more than two elements.

Time complexity

Increases with the increase in the input size.

Remains the same with the increase in the input size.

Implementation

Easy to implement

complex to implement


See Also