Back to course home
0% completed
Vote For New Content
Introduction to Fast & Slow Pointers Pattern
The Fast & Slow pointer approach, also known as the Hare & Tortoise algorithm, is a pointer algorithm that uses two pointers which move through the array (or sequence/LinkedList) at different speeds. By moving at different speeds (say, in a cyclic LinkedList), the algorithm proves that the two pointers are bound to meet. The fast pointer should catch the slow pointer once both the pointers are in a cyclic loop.
.....
.....
.....
Like the course? Get enrolled and start learning!
On this page