Reverse a linked list [HackerRank] | Data Structure | LinkedList | Interview

preview_player
Показать описание
This video is about Reverse a LinkedList.
Problem Statement:
You’re given the pointer to the head node of a linked list. Change the next pointers of the nodes so that their order is reversed. The head pointer given may be null meaning that the initial list is empty.
Problem:
Code Sample:
def reverse(head):
p1=head
while p3 is not None:
p1=p2
p2=p3
return p2

For 1 : 1 Tutoring
WhatsApp contact : 7278222619

Follow me on:
Whatsapp:

Facebook:

Linkedin:

Instagram:
#hackerrank #datastructure #linkedlist
#HackerRank #DataStructure #LinkedList
Рекомендации по теме
Комментарии
Автор

When i run this code, it is showing time limit exceeded

anuragtiwari
welcome to shbcf.ru