Question: in C++ Linked List Copy Write a function that takes a linked list as an argument, and then copies it to a different link list.
Linked List Copy Write a function that takes a linked list as an argument, and then copies it to a different link list. Assumptions you can make is that the linked list that is the destination is empty, so both head and tail pointers are null. The prototype: void list_copy (const LinkedList& source list, LinkedLists destination list): To verify that you list, copyO function worked, you can print out the second linked list in the main: /I assume you used listl as the course list, // and list2 as the destination list Node *cursor for (cursor=list2.getHeadPtr() ; cursor !=NULL ; cursor-cursor->link()) cout data)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
