two-pointer(名词)常指:
/ˈtuː ˌpɔɪntər/
The two-pointer method can find a pair that sums to the target quickly.
双指针法可以很快找到和为目标值的一对数。
By advancing one pointer to shrink the window and the other to expand it, the two-pointer approach reduces the time complexity from O(n²) to O(n) for many array problems.
通过移动一个指针来缩小窗口、另一个指针来扩展窗口,双指针思路在许多数组问题中能把时间复杂度从 O(n²) 降到 O(n)。
由 two(两个)+ pointer(指针)构成。pointer 来自 point(指向、标记),在编程语境里常指“指向数据位置的引用/索引”;因此 two-pointer 字面义就是“两个指针协同移动”。在体育语境中则是“得两分的投篮”。