Lecture 15: Abstract Data Type

 0    12 informačný list    up804653
stiahnuť mp3 vytlačiť hrať Skontrolujte sa
 
otázka English Odpoveď English
what is abstraction
začať sa učiť
Abstraction means separating the top level usefulness of a thing from the details of its implementation so that the programmers is freed from worrying about details.
what are the 2 modern methods for abstraction
začať sa učiť
control/process abstraction and data abstraction
explain control/process abstraction
začať sa učiť
Process abstraction is necessary for achieving program modularity, which means dividing up a system into components or modules, each of which can be designed, implemented, tested, reasoned about, and reused separately from the rest of the system.
what is Data Abstraction
začať sa učiť
Data abstraction enforces a clear separation between the abstract properties of a data type and the concrete details of its implementation.
what does an ADT consist of
začať sa učiť
a set of data, and necessary operations on the data.
what are Abstract Data Types (ADTs)
začať sa učiť
An abstract data type is a user-defined data type
give an example of anADT
začať sa učiť
For example, List is a widely used data structure Data: a collection of items, each item has a position in a sequential order. Operations: add/remove an item, sort the items,...
what must be decieded when designing an ADT
začať sa učiť
a set of core operations for users to use the data type. The core operations support the basic uses of the data
what are the basic rules for ADT design
začať sa učiť
[1] Basic information should not be difficult to obtain [2] The set of operations should be adequate [3] Each operation should have a well-defined purpose [4] Have a few simple operations that can be combined to perform more complex operations.
what do you need when Implementing an ADT
začať sa učiť
To implement an ADT, you need to choose: a data representation and algorithms.
what is ADT data representation
začať sa učiť
[1] internal storage container is used to hold the items in the collection, e. g an array [2] users of the ADT need not know the representation [3] users not allowed to tamper with the representation [4] all data private [5] use accessors and mutators
what is an Algorithm
začať sa učiť
[1] An algorithm for each of the necessary operations, e.g., an algorithm for sorting a list. [2] All auxiliary (helper) operations that are not in the contract should be private.

Ak chcete pridať komentár, musíte byť prihlásený.