Discuss the below:
Q: Implement, according to the instructions in parts (a) and (b), the fnction count(), which takes item as argument and returns the number of times item occurs in a list.
template -------please see attachment for this portion
int count (const list& aList, constT& item);
a) Implement the function by scanning the list and maintaining a count of the number of occurrences of item
b) Implement the function by making repeated calls to seqSearch() until the return iterator is aList.end().
template
list:: iterator seqSearch (list::iterator first, list::iterator last, const T& target)
{
list::iterator iter = first;
while(iter!= last &&(*iter!= target))
iter++
return iter;
}