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 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
Get step-by-step solutions from verified subject matter experts
