What is Data Structure?
Whenever we want to work with large amount of data, then organizing that data is very important. If that data is not organized effectively, it is very difficult to perform any task on that data. If it is organized effectively then any operation can be performed easily on that data.
A data structure can be defined as follows...
A data structure can be defined as follows...
Data structure is a method of organizing large amount of data more efficiently so that any operation on that data becomes easy
NOTE
- Every data structure is used to organize the large amount of data
- Every data structure follows a particular principle
- The operations in a data structure should not violate the basic principle of that data structure.
Based on the organizing method of a data structure, data structures are divided into two types.
- Linear Data Structures
- Non - Linear Data Structures
Linear Data Structures
If a data structure is organizing the data in sequential order, then that data structure is called as Linear Data Structure.
Example
- Arrays
- List (Linked List)
- Stack
- Queue
Non - Linear Data Structures
If a data structure is organizing the data in random order, then that data structure is called as Non-Linear Data Structure.
Example
- Tree
- Graph
- Dictionaries
- Heaps
- Tries, Etc.,