Cs520 Advanced Analysis of Algorithms and Complexity



Yüklə 198 Kb.
səhifə1/3
tarix17.09.2023
ölçüsü198 Kb.
#144546
  1   2   3
CH02- ADT and its specification

Abstract Data Type (ADT)

  • An ADT describes a set of objects sharing the same properties and behaviors
    • The properties of an ADT are its data
    • The behaviors of an ADT are its operations or functions
  • Thus, an ADT couples its data and operations
    • OOP emphasizes data abstraction
  • Abstraction: hide implementation details.
  • A data structure is the physical implementation of an ADT.
  • Logical vs. Physical Form
  • Data items have both a logical and a physical form.
  • Logical form:
  • definition of the data item within an ADT.
  • Physical form:
  • implementation of the data item within a data structure.

Data Abstraction and Basic Data Structures

  • Improving efficiency by building better
    • Data Structure
  • Object IN
    • Abstract Data Type
      • Specification
      • Design
    • Architecture [Structure, Function]
  • Abstract Data Types
    • Lists, Trees
    • Stacks, Queues
    • Priority Queue, Union-Find
    • Dictionary
  • ADT

Abstract Data type

  • Abstract Data Type
    • Structures: data structure declarations
    • Functions: operation definitions
  • An ADT is identified as a Class
    • in languages such as C++ and Java

ADT Specification

  • The specification of an ADT describe how the operations (functions, procedures, or methods) behave
  • A specification of an operation consists of:
    • Calling prototype
    • Preconditions
    • Postconditions
  • The calling prototype includes
    • name of the operation
    • parameters and their types
    • return value and its types
  • The preconditions are statements
    • assumed to be true when the operation is called.
  • The postconditions are statements
    • assumed to be true when the operation returns.

Yüklə 198 Kb.

Dostları ilə paylaş:
  1   2   3




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin