Difference between data structure, data type and abstract data type

I understand the basic concepts and definitions like :

  1. Abstract data type is abstraction that define set of values and set of operations on this values.
  2. Data structure is the way you can store the data to provide efficient ways to operate on it.
  3. Data type is kind of instruction to computer language that tells how to operate with data of this type.

What i can't figure out is that the abstraction level of this concepts and how they relate to each other. Like, okay, that's how i understand all this:

Am i right or i miss something?

p.s. sorry for my poor English.

Upvotes: 2

Views: 3278

Answers (2)

McBear Holden
McBear Holden

Reputation: 5901

ADT exits only in logical form. It's best expressed in natural language or pseudo code. Example: A List, Map, Stack, etc.

Once the ADT is implemented, it becomes a data structure. Example: A linked-list, a hashmap, etc.

Types are mostly refering to built-in primitive such as Int, Char or user defined types using other built-in types such as C struct.

However, I belive the line is not strickly drawn. For example if a language provide a linked-list as a built-in type, then it would be a type.

Please also check the discussion below: https://softwareengineering.stackexchange.com/questions/148747/abstract-data-type-and-data-structure

Upvotes: 2

Hamed Nassar
Hamed Nassar

Reputation: 19

Simply put, the relation between Data structure, Abstract data type and Data type is the same as the relation between Algorithm, Pseudo-code and Program. The first is an idea, the second a formal description (abstract, inaccessible) and the third an implementation (concrete, accessible).

Upvotes: 1

Related Questions