Computer Science, asked by MitraBhai, 7 months ago

Write a function to reverse a single linked list.​

Answers

Answered by dharmendra23182
0

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. ...

Now, disconnect the previous node i.e. the first node from others. ...

Move head node to its next node i.e. head = head->next.

Similar questions