Merge two sorted linked lists [HackerRank] | LinkedList | Data Structure | Interview

preview_player
Показать описание
Problem Statement:
You’re given the pointer to the head nodes of two sorted linked lists. The data in both lists will be sorted in ascending order. Change the next pointers to obtain a single, merged linked list which also has data in ascending order. Either head pointer given may be null meaning that the corresponding list is empty.

#HackerRank #DataStructure #Interview
Sample Problem:

Code sample:
def mergeLists(head1, head2):
p1=head1
p2=head2
head=p1
t=p1
else:
head=p2
t=p2
while(p1!=None and p2!=None):
else:
if p1==None:
else:
return head

For 1 : 1 Tutoring
WhatsApp contact : 7278222619

Follow me on:
Whatsapp:

Facebook:

Linkedin:

Instagram:
Рекомендации по теме
Комментарии
Автор

I watched many videos but yours was the best ... thankyou sir 🥳🥳✌🏻

Strange
Автор

It was helpful but voice may be little louder.

ritiksaxena
visit shbcf.ru