I will make you understand Data Structures and Algorithms in a Easy way
Before diving into the topic, you need to be familiar with few terms that are related to DSA
“What is a data structure”
It is the best possible way of storing and organising the data in memory so that we can retrieve and access that data whenever it is needed.
Example:
It’s easy to find a book in library, but difficult to find in our cupboard. And that is because in libraries books are arranged in a proper way i.e by sorting and organising.
What is an Algorithm
It is a step by step process for solving a question which is basically a program.
What is a program
It is a set of written statements or commands that instruct the computer how to process the data. There are a number of programming languages like,
C, C++, Java, Python etc.
Now, let’s start with
Types of Data Structures
- Primitive — int, char, float etc.
- Non Primitive
Our main concentration is on the 2nd type
Non -Primitive is further divided into
- Linear and
- Non Linear
In general, if we say that something is LINEAR, it means, extending along a straight line. Similarly here we are talking about the data is linearly arranged.
Examples of Linear Data Structures are
- Arrays
- Queues
- Stack
- Lists
Likewise, non linear means arranging data in different directions
Those are called Non Linear Data Structures
- Trees
- Graphs