www-unix.mcs.anl.gov/~hzhang/teach/cs401/Ch3.ppt

yle=" margin-top: 36pt; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt;
text-align: right; text-indent: 0pt; line-height: 16pt;">1


Nell Dale


Chapter 3


ADTs Unsorted List and Sorted List


Modified from the slides by Sylvia Sorkin, Community College of Baltimore
County - Essex Campus


C++ Plus Data Structures



2


Abstract Data Type (ADT)      



A data type whose properties (domain and operations) are specified independently of any particular implementation.


3



Application
(or user) level: modeling
real-life data in a specific context.


Logical
(or ADT) level: abstract
view of the domain and operations.       WHAT


Implementation
level: specific representation
of the structure to hold the data items, and the coding for operations.      HOW

Data from 3 different levels      



4


4 Basic Kinds of ADT Operations



Constructor -- creates a new instance (object) of an ADT.             
Transformer -- changes the state of one or more of the data values of an instance. 



Observer -- allows us to observe the state of one or more of the data values
of an instance without changing them.         
Iterator -- allows us to process all the components in a data structure sequentially.

4



5


C++  Built-In Data Types


Composite


array   struct   union   class


Address


pointer    reference


Simple


Integral


Floating


char  short   int  long  enum


float  double   long double



6


 

Lists


Lists in every-day life:



Grocery list
Laundry list
To-do list
Invitation list



7