VISUALGO//POINTERS
fast and slow · two-pointer trace console · O(n)
Goal:Find the middle element using two pointers — slow moves 1 step, fast moves 2 steps. When fast reaches the end, slow is at the middle.
10
04
15
28
310
417
515
619
77
86
9▲
SLOW,FASTARRAY SIZE
READOUT
step0 / 15
slow index0
fast index0
step #0
statusIDLE