Course Solutions Uncategorized (Solved) : Add New Method Find Class Singlylinkedlist Defined Takes Input Data Value Returns Pointer Q35182428 . . . .

(Solved) : Add New Method Find Class Singlylinkedlist Defined Takes Input Data Value Returns Pointer Q35182428 . . . .

 

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.

  1. Write the (single line) method declaration/specification.

  1. 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: ” <<

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post