function that Search for a given number. If the number is available, then your p
ID: 3620771 • Letter: F
Question
function that Search for a given number. If the number is available, then your program print that number and specify its position in the linked list. If the number not found, your program must print the following message" Your number is not found. Try another number". It is important to note that, if the searched number available in more than one position, your program must show these positions.i do it but how i can make program show the position
template <class t>
bool singlelinklist<t> ::search(const t& searchitem) ////**
{
nodetype<t> *current;
bool found = false;
current = first;
int c=0;
while (current !=NULL && !found )
if (current->info==searchitem)
{
found =true;
c++;
}
else
current =current->link;
return found;
}