Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

binary search

Правка en1, от Gordon-Freeman, 2024-09-22 21:06:14

Can someone explain to me how do we choose ranges when doing BinarySearch i solved a lot of BS problems but to be honest i alwayes try differnt ways until one of them work... by mean whats the diffence between writing while(l<r) and while(l<=r) and while(l+1<r)...etc and when do we set r=mid and when r=mid-1 and same for l , please someone explain them all this is the only thing confuse me at BS problems

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Gordon-Freeman 2024-09-22 21:06:14 421 Initial revision (published)