Add a new method, find, to class SinglyLinkedList (defined here)that takes as input a “data” value and returns a pointer to a node.If the input data is present in the linked list, the returnedpointer should point to that node; if not, the returned pointer isnullptr.
-
Write the (single line) method declaration/specification.
-
Write the method definition/implementation.
Test by running the main() function below and capture theconsole screen output, by attaching it as a captured image (useCTRL+PrtSc) or printed out as a file.
#include <iostream>
#include “SinglyLinkedList.hpp”
using std::cout;
using std::endl;
int main() {
SinglyLinkedList<int> ds;
for (int i=10; i<20; i++)
ds.append(i);
Node<int> *ptr = ds.find(15);
if (ptr != nullptr)
cout << “Found: ” <<
PayPal Gateway not configured
PayPal Gateway not configured