Do the whole code in C++ and please share whole program You're given the pointer to the head nodes of two linked lists. Compare the data in the nodes of the linked lists to check if they are equal. If...


Do the whole code in C++ and please share whole program<br>You're given the pointer to the head nodes of two linked lists. Compare the data in the nodes of the linked lists to check if they<br>are equal. If all data attributes are equal and the lists are the same length, return 1. Otherwise, return 0.<br>Example<br>Wlistl = 1+2+3 → NULL<br>list2 = 12+34 NULL<br>The two lists have equal data attributes for the first 3 nodes. llist2 is longer, though, so the lists are not equal. Return 0.<br>Function Description<br>Complete the compare_lists function in the editor below.<br>compare lists has the following parameters:<br>SinglyLinkedL.istNode llist1: a reference to the head of a list<br>SinglyLinkedListNode llist2: a reference to the head of a list<br>Returns<br>• int: return 1 if the lists are equal, or 0 otherwise<br>

Extracted text: Do the whole code in C++ and please share whole program You're given the pointer to the head nodes of two linked lists. Compare the data in the nodes of the linked lists to check if they are equal. If all data attributes are equal and the lists are the same length, return 1. Otherwise, return 0. Example Wlistl = 1+2+3 → NULL list2 = 12+34 NULL The two lists have equal data attributes for the first 3 nodes. llist2 is longer, though, so the lists are not equal. Return 0. Function Description Complete the compare_lists function in the editor below. compare lists has the following parameters: SinglyLinkedL.istNode llist1: a reference to the head of a list SinglyLinkedListNode llist2: a reference to the head of a list Returns • int: return 1 if the lists are equal, or 0 otherwise

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here