list - @param i the position to remove @param s the value s...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** @file list.h @author William Duncan @date 2005-10-01 Description: interface for the sorted list ADT Course: CS1254.02 Logon ID: cs1254xx Lab #: 5 Instructor: William Duncan */ /* YOUR TASK: templatize the interface below so that the list stores any arbitrary type. */ #include <string> #include <iostream> #include <cassert> #include "listtools.h" #ifndef SLIST_H #define SLIST_H class List { public: /** Constructs an empty list; */ List(); /** Inserts an element into the list. @param iter the position before which to insert @param s the value to append */ void insert(string s); /** polymorphic versions of functions that remove an element from the list.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: @param i the position to remove @param s the value s is removed @return an iterator pointing to the element after the erased element */ Iterator erase(Iterator i); Iterator erase(string s); /** Gets the beginning position of the list. @return an iterator pointing to the beginning of the list */ Iterator begin(); /** Gets the past-the-end position of the list. @return an iterator pointing past the end of the list */ Iterator end(); /** @return the number of elements in the list. */ long size() const; private: Node* first; Node* last; long length; }; //SLIST_H #endif...
View Full Document

Page1 / 2

list - @param i the position to remove @param s the value s...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online