al-go-rithms icon indicating copy to clipboard operation
al-go-rithms copied to clipboard

Two pointer technique

Open theshoonyam opened this issue 1 year ago • 0 comments

Two pointer technique is used to find two numbers from the given array whose sum is given. This Algorithm search the two number in n*log(n) time while brute force method does the same in n-square time. Since this algorithm is more efficient, it is more widely used in Competitive programming. If the given array is sorted it will take time of order n i.e. the size of input array.

theshoonyam avatar Oct 27 '22 13:10 theshoonyam