Question: write a search function that takes a string as its argument. It will return the address of the node holding the string, or Null if

write a search function that takes a string as its argument. It will return the address of the node holding the string, or Null if the pointer runs off the end of the list. this part of the code has to include:

if(cursor->data == target) return cursor;

Then write a move_front_to_back function. use an extra pointer to hold the first node in the list, then move the head to the second node of the list, and then with still another pointer find the last node in the list and hook the node that used to be at the front to the back.

Main:

write a search function that takes a string as its argument. It

Header:

will return the address of the node holding the string, or Null

#include #include #include "list!"h" using names pace std; int main() Lilist L1, L2; string target; L1. add( "Charlie" ) ; L1.add("Lisa") L1.add("Drew") L1.add("Derrick"); L1 . add ( "AJ " ) ; L1, add ( "Bojian") ; cout target; if(1.search(target ) != NULL) coutc"That name is stored at address: "

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!