Question: c ++ please Implement the present() method in the below class to return true if the passed value v is present in the list and
Implement the present() method in the below class to return true if the passed value v is present in the list and false otherwise. Assume that the method add() adds elements to the list (you don't need to implement that method). Remember that the list may be empty. struct Node { int value; Node *next; class MyList { private: Node *_head = nullptr; public: void add(int V); bool present(int ; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
