1 / 13

ENEE150 Discussion 4/24: Abstract Data Types

ENEE150 Discussion 4/24: Abstract Data Types. Introduction to Abstract Data Types. In every language, we have a set of primitive data types, such as long, int , char, etc. Using these simple data types, we can construct complex data structures to represent our information.

jill
Download Presentation

ENEE150 Discussion 4/24: Abstract Data Types

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ENEE150 Discussion 4/24: Abstract Data Types

  2. Introduction to Abstract Data Types • In every language, we have a set of primitive data types, such as long, int, char, etc. • Using these simple data types, we can construct complex data structures to represent our information

  3. A first look an ADTs • Solving a problem involves processing data, and an important part of the solution is the careful organization of the data • In order to do that, we need to identify: • The collection of data items • Basic operation that must be performed on them • Abstract Data Type (ADT): a collection of data items together with the operations on the data

  4. Abstract Data Types • A user defined data type, often complex in nature, with a strong separation of use and implementation • Attributes: • A representation of some data • A set of operations on the representation

  5. Benefits: • With a well defined interface, we can create a strong separation of use from implementation • Interface is an important part of the ADT, in order to separate out the implementation from the client, who simply needs to know how to use the data type

  6. Abstract Data Type (ADT) • The word “abstract” refers to the fact that the data and the basic operations defined on it are being studied independently of how they are implemented • We think about what can be done with the data, not how it is done

  7. Examples: • Complex Numbers • Rational Numbers • Linkedlists

  8. ADT example

  9. Implementation of ADT • An implementation of ADT consists of storage structures to store the data items and algorithms for basic operation

  10. Data Structures, Abstract Data Types, and Implementations • Consider example of an airplane flight with 10 seats to be assigned • Tasks • List available seats • Reserve a seat • How to store, access data?

  11. Data Structures, Abstract Data Types, and Implementations • Consider example of an airplane flight with 10 seats to be assigned • Tasks • List available seats • Reserve a seat • How to store, access data? • 10 individual variables

  12. Data Structures, Abstract Data Types, and Implementations • Consider example of an airplane flight with 10 seats to be assigned • Tasks • List available seats • Reserve a seat • How to store, access data? • 10 individual variables • An array of variables

  13. ADTs • In this simple example, it does illustrate the concept of an Abstract Data Type • ADT consists of • The collection of data items • Basic operation that must be performed on them • In the example, a collection of data is a list of seats • The basic operations are (1) Scan the list to determine which seats are occupied (2) change seat’s status

More Related