http://www-cs.ccny.cuny.edu/~wolberg/cs212/hw/hw3.html

1 answer below »
http://www-cs.ccny.cuny.edu/~wolberg/cs212/hw/hw3.html
Answered Same DayOct 10, 2021

Answer To: http://www-cs.ccny.cuny.edu/~wolberg/cs212/hw/hw3.html

Abr Writing answered on Oct 13 2021
150 Votes
sequence2.h
// Provided by: ____________(your name here)__________
// Email Address: ____________(your email address here)________
// FILE: sequence2.h
// CLASS PROVIDED: sequence (part of the namespace main_savitch_4)
// There is no implementation file
provided for this class since it is
// a programming assignment from Chpater 4 of "Data Structures and Other Objects Using C++"
//
// TYPEDEFS and MEMBER CONSTANTS for the sequence class:
// typedef ____ value_type
// sequence::value_type is the data type of the items in the sequence. It
// may be any of the C++ built-in types (int, char, etc.), or a class with a
// default constructor, an assignment operator, and a copy constructor.
//
// typedef ____ size_type
// sequence::size_type is the data type of any variable that keeps track of
// how many items are in a sequence.
//
// static const size_type DEFAULT_CAPACITY = _____
// sequence::DEFAULT_CAPACITY is the initial capacity of a sequence that is
// created by the default constructor.
//
//
// CONSTRUCTOR for the sequence class:
// sequence(size_type initial_capacity = DEAULT_CAPACITY)
// Postcondition: The sequence has been initialized as an empty sequence.
// The insert/attach functions will work efficiently (without allocating
// new memory) until this capacity is reached.
//
// sequence(const sequence& source)
// - write the preconditions and postconditions yourself!
//
// MODIFICATION MEMBER FUNCTIONS for the sequence class:
// void resize(size_type new_capacity)
// Postcondition: The sequence's current capacity is changed to the
// new_capacity (but not less that the number of items already on the
// sequence). The insert/attach functions will work efficiently (without
// allocating new memory) until this new capacity is reached.
//
// void start( )
// Postcondition: The first item on the sequence becomes the current item
// (but if the sequence is empty, then there is no current item).
//
// void advance( )
// Precondition: is_item returns true.
// Postcondition: If the current item was already the last item on the
// sequence, then there is no longer any current item. Otherwise, the new
// current item is the item immediately after the original current item.
//
// void insert(const value_type& entry)
// Postcondition: A new copy of entry has been inserted in the sequence before
// the current item. If there was no current item, then the new entry has
// been inserted at the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here