Science, asked by Aishwarya3355, 5 months ago

Write and explain an algorithm for rearranging the nodes in a singly linked list so as to get a reversed linked list


plz be fast...

Answers

Answered by pnnll1553
1

Answer:

Steps to reverse a Singly Linked List. Create two more pointers other than head namely prevNode and curNode that will hold the reference of previous node and current node respectively. Make sure that prevNode points to first node i.e. prevNode = head. ... Move head node to its next node i.e. head = head->next

Explanation:

Similar questions