Advertisement

Find Merge Point of Two Lists #HackerRank

Find Merge Point of Two Lists #HackerRank This video is about finding merge point of two linked list.
Problem Statement:
Given pointers to the head nodes of 2 linked lists that merge together at some point, find the Node where the two lists merge. It is guaranteed that the two head Nodes will be different, and neither will be NULL.

Problem:


Sample Code:
def findMergeNode(head1, head2):
p1=head1
p2=head2
while 1:
if p1==p2:
break
p1=p1.next
p2=p2.next
if p1==None:
p1=head2
if p2==None:
p2=head1
return p1.data

Linear Linked List in detail
Part-1.
Part-2.
Part-3.
Part-4.

find merge point of two lists hackerrank,find the merge point of two linked lists,find merge point of two lists hackerrank solution,find merge point of two lists python,find merge point of two lists java,find merge point of two lists hackerrank solution c++,find merge point of two lists hackerrank solution java,linked list in python,linkedlist for beginner,interview in data struc,

Post a Comment

0 Comments