Skip to content

Instantly share code, notes, and snippets.

View jyshnkr's full-sized avatar
👨‍💻
Focusing

JayaShankar Mangina jyshnkr

👨‍💻
Focusing
View GitHub Profile
@primaryobjects
primaryobjects / linked-list-compare.java
Created February 26, 2017 19:03
Compare two linked lists. Compare values of 2 linked lists for equality.
int CompareLists(Node headA, Node headB) {
int result = 1;
Node current1 = headA;
Node current2 = headB;
while (current1 != null && current2 != null && current1.data == current2.data) {
current1 = current1.next;
current2 = current2.next;
}