Understanding Abstract Data Types (ADT) and Data Structures

Slide Note
Embed
Share

Abstract Data Types (ADT) refer to a mathematical model defining data types based on behavior, operations, and parameters. They focus on what operations can be performed on the data, not how they are implemented. Examples include stacks (LIFO) and queues (FIFO). Data Structures determine how data is organized, such as arrays or linked lists. With ADTs, the structure doesn't need to be specified explicitly.


Uploaded on Sep 13, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Abstract Data Type (ADT) CSCE 121

  2. Abstract Data Type zyBook: a data type whose creation and update are constrained to specific well-defined operations. Wikipedia: a mathematical model for data types where a data type is defined by its behavior (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 behavior of these operations. Goodrich, et al.: a mathematical model of a data structure that specifies the type of the data stored, the operations supported on them, and the types of the parameters of the operations.

  3. Abstract Data Type What Not How

  4. Example: Stack Last in first out (LIFO) Think PEZ dispenser Principal Operations: Push(e): Add element to the top of the stack Pop(): Remove and return element from the top of the stack Other operations Size(): Return the number of elements in the stack Peek(): Return element on the top of the stack (does not remove)

  5. Example Queue First in first out (FIFO) Lines at amusement park Principal Operations: Enqueue(e): Add element to the end of the queue Dequeue(): Remove and return element at the front of the queue (i.e. the oldest one) Other operations: Size(): Return the number of elements in the queue Peek(): Return element at the front of the queue (does not remove)

  6. Data Type vs Data Structure Data structure, the specifics of how data is organized. Array Linked List With an ADT, the data structure does not have to be specified. Vector ADT Array??? Linked List???

Related


More Related Content