Question: Help me in C++ Write the definition of the function search() as a member function of the class AnyList. - Parameter: An int storing an
Help me in C++
Write the definition of the function search() as a member function of the class AnyList. - Parameter: An int storing an element to be searched. - The function traverses the list to search for the element passed by the parameter. If the element is found, the function returns true; if the element is not found, the function returns false. - The function traverses the list using a WHILE loop. - NOTE: To make your function efficient, make sure it stops when it finds the element. (Use a Boolean value.) - If the list is empty, the function prints the error message "The list is empty." - Assumption: All elements are unique. Make sure you are declaring variables ONLY before you are using them (style guidelines), otherwise you will be just wasting memory. Functions.cpp 12345678910#include"AnyList.h"#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
