You are viewing a single comment's thread. Return to all comments →
Got the same answer!
int CompareLists(Node a, Node b) { if(a == null && b == null) { return 1; } else if((a == null || b == null) || (a.data != b.data)) { return 0; } return CompareLists(a.next, b.next); }
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 →
Got the same answer!
int CompareLists(Node a, Node b) { if(a == null && b == null) { return 1; } else if((a == null || b == null) || (a.data != b.data)) { return 0; } return CompareLists(a.next, b.next); }