Two-Pointer

What is a two-pointer algorithm?

Two pointer algorithm is one of the most commonly asked questions in any programming interview. This approach optimizes the runtime by utilizing some order (not necessarily orting) of the data.

When is it useful?

It is generally applied on lists (arrays) and linked lists. This is generally used to search pairs in a sorted array.

To learn more, click here!