0
Two pointers
Can someone explain “Two pointers” technique (Easy to understand)? How do you use ? In Python or Java.
1 Resposta
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