🌐
Medium
medium.com › @RobuRishabh › two-pointers-in-c-a-path-to-optimized-algorithms-403f628053d9
Two Pointers in C++: A Path to Optimized Algorithms | by Rishabh Singh | Medium
September 8, 2024 - Examples: finding pairs summing to a target, identifying subarrays with certain properties · Sorting and Manipulation: Involves reorganizing or modifying array elements. Often uses pointers moving in different directions for efficient rearrangement · Intersection and Merge: Applied when working with two arrays or sequences.
🌐
Pluralsight
pluralsight.com › blog › tech guides & tutorials
Algorithm Templates: Two Pointers - Part 1 | Pluralsight
Applied to an algorithm, the pointer can be used to represent the current element in a sequence (such as array or string). We can combine two pointers in different traversal ways to express the complex algorithm logic.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-pointer-to-pointer-double-pointer
C - Pointer to Pointer (Double Pointer) - GeeksforGeeks
A double pointer in C is a pointer that stores the address of another pointer.
Published: July 18, 2026
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › two-pointers-technique
Two Pointers Technique - GeeksforGeeks
We use two index variables left and right to traverse from both corners. Initialize: left = 0, right = n - 1 Run a loop while left < right, do the following inside the loop ... If the sum equals the target, we’ve found the pair. If the sum is less than the target, move the left pointer to the right to increase the sum.
Published: February 13, 2026
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-program-for-two-pointers-technique
C Program for Two Pointers Technique - GeeksforGeeks
July 23, 2025 - Now let’s see how the two-pointer technique works. We take two pointers, one representing the first element and other representing the last element of the array, and then we add the values kept at both the pointers.
🌐
AlgoDaily
algodaily.com › lessons › using-the-two-pointer-technique
AlgoDaily - Using the Two Pointer Technique
The name two pointers does justice ... It's the use of two different pointers (usually to keep track of array or string indices) to solve a problem involving said indices with the benefit of saving time and space....
🌐
AlgoMonster
algo.monster › problems › two_pointers_intro
Two Pointers Introduction
Advance the pointer in the longer string every step; each time its letter matches the current letter of the shorter string, advance that pointer too. If the shorter string's pointer reaches the end, every letter was found in order, so it is a subsequence. Both pointers only ever move forward, and neither string is modified. Here the two pointers start at opposite ends and move toward each other.
🌐
Medium
medium.com › @johnnyJK › data-structures-and-algorithms-907a63d691c1
DATA STRUCTURES AND ALGORITHMS. Two Pointers Technique | by John Kamau | Medium
September 6, 2023 - The two-pointer technique is a ... science. This strategy involves the use of two pointers, often represented as indices or references, that traverse a data structure, such as an array, list, or string, simultaneously...
Find elsewhere
🌐
SDSU
edoras.sdsu.edu › doc › c › pointers-1.2.2
Everything you need to know about pointers in C
Thus it is an ‘int pointer’ (a pointer to int). An int **’s type is int * (it points to a pointer to int). The use of pointers to pointers is called multiple indirection. More on that in a bit. The obvious way to declare two pointer variables in a single statement is:
🌐
LeetCode
leetcode.com › articles › two-pointer-technique
Two-pointer technique
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
🌐
Codecademy
codecademy.com › docs › pointers › double pointer
C | Pointers | Double Pointer | Codecademy
May 29, 2025 - In C, a double pointer is a pointer that holds the memory address of another pointer.
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_pointer_to_pointer.htm
Pointer to Pointer (Double Pointer) in C
A pointer to pointer which is also known as a double pointer in C is used to store the address of another pointer. A variable in C that stores the address of another variable is known as a pointer.
🌐
Yale University
cs.yale.edu › homes › aspnes › pinewiki › C(2f)Pointers.html
C/Pointers
The effect of p+n where p is a pointer and n is an integer is to compute the address equal to p plus n times the size of whatever p points to (this is why int * pointers and char * pointers aren't the same). Subtract one pointer from another. The two pointers must have the same type (e.g.
🌐
SEI CERT
wiki.sei.cmu.edu › confluence › display › c › ARR36-C.+Do+not+subtract+or+compare+two+pointers+that+do+not+refer+to+the+same+array
ARR36-C. Do not subtract or compare two pointers that do not refer to the same array - SEI CERT C Coding Standard - Confluence
When two pointers are subtracted, both must point to elements of the same array object or just one past the last element of the array object (C Standard, 6.5.7 [ISO/IEC 9899:2024]); the result is the difference of the subscripts of the two array elements. Otherwise, the operation is undefined ...
🌐
Hello Interview
hellointerview.com › learn › code › two-pointers › overview
Two-Pointer Overview
This continues until either our ... our target, like we did here. ... The two-pointer technique leverages the fact that the input array is sorted to eliminate the number of pairs we consider from O(n2)down to O(n)....
🌐
BeginnersBook
beginnersbook.com › 2014 › 01 › c-pointer-to-pointer
C – Pointer to Pointer (Double Pointer) with example
In this guide, we will learn what is a double pointer, how to declare them and how to use them in C programming. To understand this concept, you should know the basics of pointers. ... Here pr is a double pointer. There must be two *’s in the declaration of double pointer.
🌐
ByteByteGo
bytebytego.com › courses › coding-patterns › two-pointers › introduction-to-two-pointers
Introduction to Two Pointers
This is ideal for problems where we need to compare elements from different ends of a data structure. Unidirectional traversal In this approach, both pointers start at the same end of the data structure (usually the beginning) and move in the same direction: These pointers generally serve two different but supplementary purposes.
🌐
USACO
usaco.guide › home › silver › two pointers
Two Pointers · USACO Guide
The Two Pointers method iterates two pointers across an array to track indices satisfying some condition.