In general both data type and data structure seems to be the same thing as both deals with the nature and organizing of data but among two one describes the type and nature of data while other represents the collections in which that data can be stored.
Following are the important differences between Data Type and Data Structure
Key | Data Type | Data Structure |
---|---|---|
Definition | Data type is the representation of nature and type of data that has been going to be used in programming or in other words data type describes all that data which share a common property. For example an integer data type describes every integer that the computers can handle. | On other hand Data structure is the collection that holds data which can be manipulated and used in programming so that operations and algorithms can be more easily applied. For example tree type data structures often allow for efficient searching algorithms. |
Implementation | Data type in programming are implemented in abstract implementation whose definition is provided by different languages in different ways. | On other hand Data type in programming are implemented in concrete implementation as their definition is already defined by the language that what type of data they going to store and deal with. |
Storage | In case of data type the value of data is not stored as it only represents the type of data that can be get stored. | On other hand data structure holds the data along with its value that actually acquires the space in main memory of the computer. Also data structure can hold different kind and types of data within one single object |
Assignment | As data type already represents the type of value that can be stored so values can directly be assigned to the data type variables. | On other hand in case of data structure the data is assigned to using some set of algorithms and operations like push, pop and so on. |
Performance | If case of data type only type and nature of data is concern so there in no issue of time complexity. | On other hand time complexity comes in case of data structure as it mainly deals with manipulation and execution of logic over data that it stored. |