technojam/Ultimate_Algorithms_Repository

Two Pointer Techniques

オープン

#315 opened on 2020/10/16

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (165 件のフォーク)auto 404
hacktoberfest

Repository metrics

Stars
 (87 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Title or Name of the Algorithm

  • Two pointer algorithms

Describe the algorithm The two-pointer technique is a useful tool to utilize when searching for pairs in a sorted array. Although not it’s only use case, when used this technique can save both time and space complexity.

When iterating through data this usually implies a single starting point and movement through the data in one direction. However, as the two-pointer technique implies, there are two points of consideration and they both (usually) move towards the middle of the data being iterated over.

コントリビューターガイド