You are viewing a single comment's thread. Return to all comments →
Here is my solution in C++. It's pretty simple.
if (headA == NULL && headB == NULL) { return 1; } else if (headA == NULL || headB == NULL) { return 0; } if (headA->data == headB->data) { return CompareLists(headA->next, headB->next); } else { return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Compare two linked lists
You are viewing a single comment's thread. Return to all comments →
Here is my solution in C++. It's pretty simple.