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