//collect2.cpp //methods for class Collection implemented using public inheritance #include "collect2.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); }