Skip to content

Instantly share code, notes, and snippets.

@Preetiraj3697
Forked from rahul4coding/CompareLists.js
Created October 21, 2022 05:43
Show Gist options
  • Save Preetiraj3697/1d649cd6c37a726fae6fa892ed9687de to your computer and use it in GitHub Desktop.
Save Preetiraj3697/1d649cd6c37a726fae6fa892ed9687de 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
}
}
@Preetiraj3697
Copy link
Author

Comparing Two Linked Lists | JS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment