Definition of ADT

2/24/99


Click here to start


Table of Contents

PPT Slide

Definition of ADT

Implementing an ADT

Encapsulation of Data

Creating an ADT

Guidelines for Selecting ADT Operations

Types of ADT Operations to Include

Definition of ADT Stack

StackType ADT Operations

ADT Stack Operations

PPT Slide

Stack of int items

Stack of float items

Stack of string items

PPT Slide

PPT Slide

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

End of Trace

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

Another Stack Implementation

What is a Class Template?

Using class templates

PPT Slide

PPT Slide

PPT Slide

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Tracing Client Code

Dynamically Linked Stack

Pointer Dereferencing and Member Selection

PPT Slide

PPT Slide

PPT Slide

Using operator new

Adding newItem to the stack

Adding newItem to the stack

Adding newItem to the stack

Adding newItem to the stack

Adding newItem to the stack

Adding newItem to the stack

Implementing Push

Using operator delete

Deleting item from the stack

Deleting item from the stack

Deleting item from the stack

Deleting item from the stack

Deleting item from the stack

PPT Slide

PPT Slide

Why is a destructor needed?

PPT Slide

PPT Slide

What happens . . .

Passing a class object by value

Pass by value makes a shallow copy

Shallow Copy vs. Deep Copy

What’s the difference?

Making a deep copy

Suppose MyFunction Uses Pop

MyStack.topPtr is left dangling

MyStack.topPtr is left dangling

As a result . . .

More about copy constructors

Copy Constructor

PPT Slide

Classes with Data Member Pointers Need

PPT Slide

What about the assignment operator?

PPT Slide

Overloading the assignment operator

C++ Operator Overloading Guides

Using overloaded binary operator=

Using overloaded binary operator+

What is ADT Queue?

Queue ADT Operations

ADT Queue Operations

class QueueType<char>

PPT Slide

PPT Slide

PPT Slide

PPT Slide

Author: Sylvia Sorkin

Email: ssorkin@essex.cc.md.us

Home Page: http://www.essex.cc.md.us/Essex/People/ssorkin/index.html

Download presentation source