As name suggests, it is a way of organizing and storing data in memory in such manner that we can perform operations on the stored data more efficiently.
To structure the data many algorithms were proposed, which are known as abstract data type
- Primitive Data Structure
- Non-Primitive Data Structure
These are the primitive data types which can hold the single value. For example int, char, float, double, pointer.
These are further divided into two parts:
- Linear Data Structure
- Non - Linear Data Structure
-
It is a type of data structure where the arrangement of data is such that the each element is directly connected to its previous and next elements.
For example: Array, Linked List, Queue, Stack. - All the elements in linear data structure can be traversed in single run.
-
It is a type of data structure where the arrangement of data is such that the each element is directly connected with more than one element.
For example: Trees, Graphs. - All the elements in non - linear data structure can not be tranversed in a single run.
- Static Data Structure
- Dynamic Data Structure
It is a data structure having fixed maximum size as the size is allocated to it during compile time.
For example: Arrays
It is a data structure having flexibilty to grow or shrink in size as the size is allocated to it during runtime.
For example: Linked List, Stack, Queue, Trees.
As applications are getting complexed and amount of data is increasing day by day, there may arise the following problems:
Processor Speed:
To handle very large amount of data, high speed processing is required, but as data is growing day by day to the billions of files per entity, processor may fail to deal with that much amount of data.
Data Search:
Consider a student record in college, if one wants to search for the student whose name is in 1116 position, than the application needs to traverse 1116 items every time to search for a particular item, thus results in slowing down the search process.
Multiple Request:
If thousands of users are searching the data simultaneously on a web server, then there may be a chance that a large server get failed during the process. So, in order to solve this hassle, data structures are used. Data is organized to form a data structure in such a way that all items are not required to be searched and required data can be searched instantly.
- It allows storing of information.
- Appropriate choice of abstract data type makes the program more efficient.
- Data Structures are necessary for designing efficient algorithms.
- It provides reusability and abstraction.
- Using appropriate data structure, can help programmers save a good amount of time while performing operations such as storage, retrieval or processing of data.
- Manipulation of large amounts of data is easier.
This repository needs a ⭐ from you. Don't forget to leave a ⭐.