Блог пользователя p0uya3767

Автор p0uya3767, история, 5 месяцев назад, По-английски

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 ==================

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится