Segregate even and odd nodes in a linked list
Segregate Even and Odd Nodes in a Linked List
Problem Description
In a linked list, the goal is to rearrange the nodes such that all even-valued nodes appear before all odd-valued nodes. The relative order of the even and odd nodes should remain the same as in the original list. For example, given the linked list 1 -> 2 -> 3 -> 4 -> 5, the output should be 2 -> 4 -> 1 -> 3 -> 5.
Video Explanation
