Concept Flow - Find Middle Element of Linked List
Start: head points to first node
Initialize two pointers: slow and fast at head
Loop: fast != null and fast.next != null?
NoāStop
Yes
Move slow by 1 node
Move fast by 2 nodes
Repeat loop
slow now points to middle node
Return slow.data as middle element
Two pointers move through the list at different speeds; when fast reaches the end, slow is at the middle.
