Abstract Data Type (ADT)

Slides:



Advertisements
Similar presentations
STACKS & QUEUES. Stacks Abstract data types An abstract data type (ADT) is an abstraction of a data structure An ADT specifies : –Data stored –Operations.
Advertisements

Stacks and Queues. Not really data structures – More of an enforcement of policy – Can be implemented using an array or linked list – Can store just about.
CS Data Structures II Review COSC 2006 April 14, 2017
Chapter 3 Stacks.
Data Structures & Algorithms
CS 106 Introduction to Computer Science I 12 / 11 / 2006 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 26 / 2009 Instructor: Michael Eckmann.
1 Data Structures  We can now explore some advanced techniques for organizing and managing information  Chapter 12 of the book focuses on: dynamic structures.
CS 106 Introduction to Computer Science I 12 / 13 / 2006 Instructor: Michael Eckmann.
1 Lecture 26 Abstract Data Types – IV Overview  The List ADT  Implementing Stacks as Linked List  Linked List Implementation of Queues .  Preview:
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
© 2004 Pearson Addison-Wesley. All rights reserved12-1 Chapter 12 : Collections Intermediate Java Programming Summer 2007.
Stacks and queues Basic operations Implementation of stacks and queues Stack and Queue in java.util Data Structures and Algorithms in Java, Third EditionCh04.
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
Stacks and Queues Introduction to Computing Science and Programming I.
Copyright © 2012 Pearson Education, Inc. Chapter 18: Stacks And Queues.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 18 Stacks and Queues.
September 05 Kraemer UGA/CSCI 2720 Lists – Part I CSCI 2720 Eileen Kraemer The University of Georgia.
CMSC 202 Stacks and Queues. What’s a Queue? A queue is a linear collection of homogeneous data in which items added to the queue must be placed at the.
Data Structures (part 2). Stacks An Everyday Example Your boss keeps bringing you important items to deal with and keeps saying: “Put that last ‘rush’
Stacks And Queues Chapter 18.
Cousin of the Stack.  An abstract data type (container class) in which items are entered at one end and removed from the other end  First In First.
Foundations of Data Structures Practical Session #4 Recurrence ADT 08/04/2013Amihai Savir & Ilya Mirsky
Chapter 4 Stacks and Queues © 2006 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
CH 5 : STACKS, QUEUES, AND DEQUES ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA.
Stacks and Queues CMSC 201. Stacks and Queues Sometimes, when we use a data-structure in a very specific way, we have a special name for it. This is to.
3/3/20161 Stacks and Queues Introduction to Data Structures Ananda Gunawardena.
Stacks. What is a Stack? A stack is a type of data structure (a way of organizing and sorting data so that it can be used efficiently). To be specific,
CS-2851 Dr. Mark L. Hornick 1 Stacks and Queues Behavior vs. Structure.
CPS120: Introduction to Computer Science Nell Dale John Lewis Abstract Data Types.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 18: Stacks and Queues.
Circular Queues Maitrayee Mukerji. Queues First In – First Out (FIFO) The first element to be inserted is the first one to be retrieved Insertion at one.
Stack ADT (Abstract Data Type) N …
Stack: a Linked Implementation
Queues Chapter 8 (continued)
Comprehensive Introduction to OOP with Java, C. Thomas Wu Stack ADT
Cpt S 122 – Data Structures Abstract Data Types
18 Chapter Stacks and Queues
Chapter 18: Stacks and Queues.
G64ADS Advanced Data Structures
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
COSC160: Data Structures: Lists and Queues
September 29 – Stacks and queues
Chapter 15 Lists Objectives
Chapter 12: Data Structures
Objectives In this lesson, you will learn to: Define stacks
Stacks and Queues.
Stack and Queue Author : Srinadh Gunnam.
Chapter 13 Queues and Priority Queues
Introduction to Data Structure
Data Structures and Database Applications Queues in C#
Basic Data Types Queues
Building Java Programs
CMSC 341 Lecture 5 Stacks, Queues
structures and their relationships." - Linus Torvalds
Principles of Computing – UFCFA3-30-1
Chapter 19: Stacks and Queues.
structures and their relationships." - Linus Torvalds
Lecture 21 Stacks and Queues Richard Gesick.
ITEC 2620M Introduction to Data Structures
CSE 214 – Computer Science II Stacks
Stack A data structure in which elements are inserted and removed only at one end (called the top). Enforces Last-In-First-Out (LIFO) Uses of Stacks Evaluating.
Queues cont. Chapter 8 © 2011 Pearson Addison-Wesley. All rights reserved.
Lecture 16 Stacks and Queues CSE /26/2018.
structures and their relationships." - Linus Torvalds
Abstract Data Types Stacks CSCI 240
Abstract Data Types (ADTs)
CMPT 225 Lecture 8 – Queue.
Stack Implementations
Data Structures & Programming
Presentation transcript:

Abstract Data Type (ADT) CSCE 121 J. Michael Moore

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.

Abstract Data Type What Not How

Example: Stack Last in first out (LIFO) Operations: Think PEZ dispenser Operations: Push(e): Insert item on top of stack Pop(): Remove item from top of stack Peek(): Look at item on top of stack (does not remove)

Example Queue First in first out (FIFO) Operations: Lines at amusement park Operations: Enqueue(e): Insert at the end of the queue Dequeue(): Remove from the front of the queue (i.e. the oldest one) Front(): Return from the front of the queue, but do not remove

zyBook Example: Vector Operations at(index) size() empty() clear() push_back(element) erase(index) insert(index, element)

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???

In C++ Generally the public interface, i.e. the public members of a class.