Question: CODE IN PYTHON PLEASE THOROUGHLY COMMENT Assume you already have an implemented LinkedList class. You're given the pointer to the head nodes of two linked

 CODE IN PYTHON PLEASE THOROUGHLY COMMENT Assume you already have an

CODE IN PYTHON

PLEASE THOROUGHLY COMMENT

Assume you already have an implemented LinkedList class. You're given the pointer to the head nodes of two linked lists. Your task is to write a funciton Compare Lists(headA, headB) that could compare the data in the nodes of the linked lists to check if they are equal. This function should return True if two linked listes are equal and False otherwise. The lists are equal only if they have the same number of nodes and corresponding nodes contain the same data. Either head pointer given may be null meaning that the corresponding list is empty

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!