Abstract and Primitive Data Types (ADT)

10,371

Data types are classification of data in any programming language - for example integers, characters, floats etc.

Abstract Data type is a theoretical concept. An abstract data type (ADT) is a mathematical model for data types where a data type is defined by its behaviour (semantics) from the point of view of a user of the data, specifically in terms of possible values, possible operations on data of this type, and the behaviour of these operations.A set of data values and associated operations that are precisely specified independent of any particular implementation. Abstract data type (ADT) is a specification of a set of data and the set of operations that can be performed on the data.

For Example : Stack is an Abstract Data Type. A stack ADT can have the operations push, pop, peek. These three operations define what the type can be irrespective of the language of the implementation.

So we can say, Primitive data types are a form of Abstract data type. It is just that they are provided by the language makers and are very specific to the language. So basically there are 2 types of data types primitives and user defined. But both of them are abstract data types. I hope this makes it clear.

Share:
10,371
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I know this question has been asked a million times but Can someone please explain to me what ADT exactly means (in layman's terms if possible) ?

    I read this definition of ADT- ADT only mentions what operations are to be performed but not how these operations will be implemented. So is the case with primitive data types.

    Suppose if we have a float data type, we know that multiplication, division, etc. operations can be performed (so we know what operations will be performed) but we don't how it'll be performed (in case of multiplication we can just multiply or repeatedly add, so we have two processes giving the same result and therefore it's abstract). So both data types are essentially the same. (I know it's incorrect).

    I know I'm getting it all wrong. Can someone please help me clear this concept?