How Data Structure varies from Data Type:
We already have learned about data structure. Many times, what happens is that people get confused between data type and data structure. So let’s see a few differences between data type and data structure to make it clear.
Data Type |
Data Structure |
---|---|
The data type is the form of a variable to which a value can be assigned. It defines that the particular variable will assign the values of the given data type only. |
Data structure is a collection of different kinds of data. That entire data can be represented using an object and can be used throughout the program. |
It can hold value but not data. Therefore, it is dataless. |
It can hold multiple types of data within a single object. |
The implementation of a data type is known as abstract implementation. |
Data structure implementation is known as concrete implementation. |
There is no time complexity in the case of data types. |
In data structure objects, time complexity plays an important role. |
In the case of data types, the value of data is not stored because it only represents the type of data that can be stored. |
While in the case of data structures, the data and its value acquire the space in the computer’s main memory. Also, a data structure can hold different kinds and types of data within one single object. |
Data type examples are int, float, double, etc. |
Data structure examples are stack, queue, tree, etc. |