Container Classes

9/5/97


Click here to start


Table of Contents

Container Classes

Programming Assignment 1

Programming Assignment 1

Programming Assignment 1

Homework Assignment 1

Bags

Bags

Initial State of a Bag

Inserting Numbers into a Bag

Inserting Numbers into a Bag

Inserting Numbers into a Bag

Inserting Numbers into a Bag

Inserting Numbers into a Bag

Inserting Numbers into a Bag

Examining a Bag

Removing a Number from a Bag

Removing a Number from a Bag

How Many Numbers

Summary of the Bag Operations

The Bag Class

The Bag Class

PPT Slide

PPT Slide

The Bag’s Default Constructor

The Insert Function

The Size Function

The Size Function

The Occurrences Function

The Remove Function

Using the Bag in a Program

The Header File and Implementation File

Documentation for the Bag Class

The Bag’s Class Definition

The Implementation File

A Quiz

A Quiz

Implementation Details

Implementation Details

Implementation Details

Implementation Details

An Exercise

An Exercise

An Exercise

The Invariant of the Bag ADT

Invariant of the Bag ADT (ctd.)

Invariant Documentation

Invariant documentation (ctd.)

An Example of Calling Insert

An Example of Calling Insert

An Example of Calling Insert

Pseudocode for Bag::insert

Pseudocode for Bag::insert

Pseudocode for Bag::insert

The Other Bag Operations

Other Kinds of Bags

Summary

THE END

Constructor for the Bag ADT

Value Semantics

Member Functions

Operator +=

Operator +

The List ADT

Author: Michael Main and Walter Savitch

Email: mgv@cs.sc.edu

Home Page: www.cs.sc.edu/~mgv

Other information:
These slides are modifications of slides provided by the authors of the textbook.