Showing posts with label traverse the linked list only once to get middle node. Show all posts
Showing posts with label traverse the linked list only once to get middle node. Show all posts

Find the middle node of a given linked list

Given a singly linked list, find the middle NODE of the linked list. For example, if given linked list is 1->2->3->4->5 then output should be 3. If there are even nodes, then there would...