p0uya3767's blog

By p0uya3767, history, 5 months ago, In English

Two pointers is a very simple and useful algorithm and actually using it is optional but, using it will make your algorithm easier and more simple.

but now, how to use it ? I think its good for you to look at https://www.geeksforgeeks.org/two-pointers-technique/ too. it'll be useful:blush:

so let go ...

As it's shown by its name this algorithm use two pointers on an array(or two arrays) which initially are located at position x, y . then if CONDITION1 move pointer1 one to left/right and if CONDITION2 move pointer2 one to left or right.

now let's switch to code.

QUESTION ANSWER SPOIL DANGER ==================

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it