0

Two pointers

Can someone explain “Two pointers” technique (Easy to understand)? How do you use ? In Python or Java.

8th Oct 2023, 10:35 AM
นฤสรณ์ อริยสกุลวงศ์
นฤสรณ์ อริยสกุลวงศ์ - avatar
1 ответ
0
example find two numbers from array whose sum is target number n + m = target if found return true pointer1 points to n pointer2 points to m in array, pointer means array index array is sorted generally: find value(s) in a datastructure which meets the condition and use two pointers rather than one
8th Oct 2023, 3:58 PM
zemiak