Data Structure: Basic Introduction
What is Data Structure?
The Logical and Mathematical Collection of Interrelated Data in an organised way.
Why do we need data structure?
From exam point of view:
Data Structure and Algorithms contains a big marks weightage in almost every standard examination, placement interviews and even if you are doing M. Tech. So, it makes it so important for us to study data structures.
From achievers point of view:
It gives you a big idea of, "What to use and when to use sort of thing". Concepts of being a successful programmer, and writing a program which is most optimised. And opens endless possibilities to be good in every subjects of CS-IT and CP (Compititive Programming).
What is algorithm?
The step by step process of solving problem is called an algorithm.
Real life analogy
Let's assume you are far from your home. And you had a call from your father. And he wants to email a document to his boss (Generally, they don't know how to do by their own... No disrespect 🙏) so, he called you and asked to instruct him. So how you start, you tell him to open your web browser and search for gmail.com now enter your email address click on next and then enter your password and so on. That's how you give him step by step process to make him complete his task. That's how computers work. You have to give him step by step algorithm to make your task completed.
Classification of Data Structure
Data Structure is classified into two parts primitive and non primitive. Further non-primitive is classified into two parts which is linear and non-linear. Further linear is divided into two parts static and dynamic. And non-linear in Two which are parent chain and hierarchical.
Primitive DS: It is the system pre defined or pre declared data structure and can store only one type of values.
Example: Integer, Float, Character.
Non Primitive DS: It is the user defined data structure, means we are the one who will choose what and how to store our data in what manner.
And the things in the hand of humans, it's sure that it becomes more and more vast and diversified...Haha 😂😅
And our whole syllabus of DATA STRUCTURE is based on Non Primitive data structure.
Hence, it is further divided into two parts:
Linear Data Structure: It is a type of data structure in which all the elements are arranged in sequential or say in linear fashion. In which an element is connected to its previous and next adjacent element.
Example: Array, Linked list, Stack, Queue.
Now, linear data structure is also divided into two more types:
Static: As you have already guessed, static means fixed. You are right, the data structure which are fixed in size. Means once memory is allocated you can't change at runtime.
Example: Array.
Dynamic: In this type of DS memory is allocated at runtime.
Example: Linked-List.
Non Linear Data Structure: It is a type of data structure in which elements are arranged in non sequential order hence, non-linear.
Example: Tree and Graph.
Non-linear DS also divided into two type:
⛓️Parent chain & Hierarchical Data Structure
As such explanation of these DS is not necessary for any exams. Examples are Tree, Graph respectively.
So, this is the basic introduction to data structure and hopefully your queries are cleared. If you want to ask me or suggest me something plz feel free to drop a comment or EMAIL📨 me through given email.
Do Share this among the needful if you find it valuable.🙏