template class List { public: List(); List( const List & ) throw ( bad_alloc ); ~List(); void add( unsigned, const T & ) throw ( bad_alloc, out_of_range ); void addFirst( const T & ) throw ( bad_alloc ); void addLast( const T & ) throw ( bad_alloc ); void clear(); bool contains( const T & ) const; bool empty() const; int indexOf( const T & ) const; T &get( unsigned ) const throw ( out_of_range ); T &getFirst() const throw ( NoSuchObject ); T &getLast() const throw ( NoSuchObject ); T remove( unsigned ) throw ( out_of_range ); T removeFirst() throw ( NoSuchObject ); T removeFirstOccurrence( const T & ) throw ( NoSuchObject ); T removeLast() throw ( NoSuchObject ); T removeLastOccurrence( const T & ) throw ( NoSuchObject ); T set( unsigned, const T & ) throw ( out_of_range ); unsigned size() const; const List &operator=( const List & ) throw ( bad_alloc ); void printInternal( ostream & = cout ); private: Node *frontPtr, *backPtr; unsigned sz; void initialize(); Node *getIthNode( unsigned ) const throw ( out_of_range ); }; // List class