Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

DSA - Data Structure & Algorithms

Back



Data Structure


Data Structure & Algorithms


Types of Data Structure


Linear data structure


Array


Stack

stack


Queue

queue


Linked List

linked list


Non linear data structures


Graph

graph


Tree

tree


Linear Vs Non-linear Data Structures

Now that we know about linear and non-linear data structures, let’s see the major differences between them.

Linear Data Structures Non Linear Data Structures
in sequential order, one after the other. in non-sequential order (hierarchical manner).
All the items are present on the single layer. The data items are present at different layers.
can traverse all the elements sequentially in a single pass. requires multiple runs. might not be possible to traverse all the elements in a single pass.
The memory utilization is not efficient. Different structures utilize memory in different efficient ways depending on the need.
Time complexity increase with the data size. Time complexity remains the same.
Example: Arrays, Stack, Queue Example: Tree, Graph, Map

TOP