Skip to content

Instantly share code, notes, and snippets.

@rahul4coding
Created December 16, 2019 19:05
Show Gist options
  • Save rahul4coding/aaf6dbb61f9c74da59ecd6604b3a1e37 to your computer and use it in GitHub Desktop.
Save rahul4coding/aaf6dbb61f9c74da59ecd6604b3a1e37 to your computer and use it in GitHub Desktop.
Comparing Two Linked Lists | JS
function CompareLists(a, b) {
while(a!==null && b!==null){
if(a.data !== b.data){
return 0
}else{
a=a.next;
b=b.next;
}
}
if(a==null && b==null){
return 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment