A Data Structure is a Specific way to store and organize data in a computer's memory so that these data can be used efficiently later. Data may be arranged in many different ways such as the logical or mathematical model for a particular organization of data is term as a data structure.
The variety of a particular data model depends on two factors: -
- Firstly, it must be loaded enough in structure to reflect the actual relationships of the data with the real-world object.
- Secondly, the formation should be simple enough so that anyone can efficiently process the data each time it is necessary.
Categories of Data Structure
The data structure can be sub-divided into major types:
- Linear Data Structure
- Non-linear Data Structure
Linear Data Structure:
A data structure is said to be linear if its elements combine to form any specific order. There are basically two techniques for representing such linear structures within memory.
- The first way is to provide the linear relationships among all the elements represented by means of a linear memory location. These linear structures are termed arrays.
- The second technique is to provide the linear relationship among all the elements represented by using the concept of pointers or links. These linear structures are termed linked lists.
The common examples of the linear data structure are: -
- Arrays
- Queues
- Stacks
- Linked lists
Non-linear Data Structure:
This structure is mostly used for representing data that contains a hierarchical relationship among various elements.
Examples of Non-Linear Data Structures are: -
- Graphs
- Family of Trees
- Table of contents