| | | | | |

List Public Interface

  • Modifying list structure
  • bool         PushFront (const T& t);              // Insert t at front of list
    bool         PushBack  (const T& t);              // Insert t at back of list
    bool         Insert    (Iterator& I, const T& t); // Insert t at I
    bool         PopFront  ();                        // Remove the Tval at front
    bool         PopBack   ();                        // Remove the Tval at back
    bool         Remove    (Iterator& I);             // Remove item at I
    unsigned int Remove    (const T& t);              // Remove all copies of t
    void         Clear     ();                        // Empty the list
    
  • Information about the list
  • unsigned int Size  () const; // return the number of elements on the list
    bool         Empty () const; // true iff list has no elements
    

| | Top of Page | 8. A Generic List Class and Linked Lists - 4 of 19