You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A linked list is a collection of nodes. First node is called head node and last node called the tail node.
Now, given a pointer to the head node of a linked list, can you reverse the linked list i.e. New list must start with tail node and end at head node. So it becomes the reverse of the original list.
Example:
Original List: head -> 1 -> 2 -> 3 -> 4 -> 5 -> NULL
Complete the function reverseList() given in the editor, which takes the head node of a linked list as a parameter, and returns the new head of reversed list.