technojam/Ultimate_Algorithms_Repository

Two Pointer Techniques

开放

#315 创建于 2020年10月16日

 (1 条评论) (0 个反应) (0 位负责人)C++ (165 个派生)auto 404
hacktoberfest

仓库指标

星标
 (87 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南