//collect3.cpp //methods for class Collection implemented using private inheritance #include "collect3.h" //constructor Collection::Collection():List() {} //returns number of elements in the Collection int Collection::size() { int count = 0; Node *p = firstnode(); while(p) { count++; p = p->getnext(); } return count; } //returns true if element belongs to the Collection, otherwise returns false int Collection::includes(Type elt) { return find(elt); } //adds an element to the Collection void Collection::add(Type elt) { if (includes(elt)) return; insertfront(elt); } //returns true if Collection is empty, otherwise returns false int Collection::isempty() { return List::isempty(); }