Two Pointer Method

Two Pointer Method

This method is quite helpful in array's to do in-place operations and help us to save an extra space of O(n).

This technique can also be used to solve:

  • Slow-pointer and fast-pointer problem in Linked List

  • Sliding Window Problem

Iterate the array from two ends to the middle. One slow-runner and one fast-runner at the same time.

Last updated