What is ADT? (Abstract Data Type)

前端 未结 18 1098
借酒劲吻你
借酒劲吻你 2020-12-12 13:04

I am currently studying about Abstract Data Types (ADT\'s) but I don\'t get the concept at all. Can someone please explain to me what this actually is? Also what is collecti

相关标签:
18条回答
  • 2020-12-12 13:37

    In programming languages, a type is some data and the associated operations. An ADT is a user defined data aggregate and the operations over these data and is characterized by encapsulation, the data and operations are represented, or at list declared, in a single syntactic unit, and information hiding, only the relevant operations are visible for the user of the ADT, the ADT interface, in the same way that a normal data type in the programming language. It's an abstraction because the internal representation of the data and implementation of the operations are of no concern to the ADT user.

    0 讨论(0)
  • 2020-12-12 13:37

    The term data type is as the type of data which a particular variable can hold - it may be an integer, a character, a float, or any range of simple data storage representation. However, when we build an object oriented system, we use other data types, known as abstract data type, which represents more realistic entities.

    E.g.: We might be interested in representing a 'bank account' data type, which describe how all bank account are handled in a program. Abstraction is about reducing complexity, ignoring unnecessary details.

    0 讨论(0)
  • 2020-12-12 13:40

    To solve problems we combine the data structure with their operations. An ADT consists of two parts:

    1. Declaration of Data.
    2. Declaration of Operation.

    Commonly used ADT's are Linked Lists, Stacks, Queues, Priority Queues, Trees etc. While defining ADTs we don't need to worry about implementation detals. They come into picture only when we want to use them.

    0 讨论(0)
  • 2020-12-12 13:41

    Abstract Data Type(ADT) is a data type, where only behavior is defined but not implementation.

    Opposite of ADT is Concrete Data Type (CDT), where it contains an implementation of ADT.

    Examples:
    Array, List, Map, Queue, Set, Stack, Table, Tree, and Vector are ADTs. Each of these ADTs has many implementations i.e. CDT. The container is a high-level ADT of above all ADTs.

    Real life example:
    book is Abstract (Telephone Book is an implementation)

    enter image description here

    0 讨论(0)
  • 2020-12-12 13:41

    ADT is a set of objects and operations, no where in an ADT’s definitions is there any mention of how the set of operations is implemented. Programmers who use collections only need to know how to instantiate and access data in some pre-determined manner, without concerns for the details of the collections implementations. In other words, from a user’s perspective, a collection is an abstraction, and for this reason, in computer science, some collections are referred to as abstract data types (ADTs). The user is only concern with learning its interface, or the set of operations its performs...more

    0 讨论(0)
  • 2020-12-12 13:47

    Abstract Data type is a mathematical module that includes data with various operations. Implementation details are hidden and that's why it is called abstract. Abstraction allowed you to organise the complexity of the task by focusing on logical properties of data and actions.

    0 讨论(0)
提交回复
热议问题