LeetCode 69 Sqrt(x) (Binary Search) | JSer - JavaScript & Algorithm

preview_player
Показать описание
LeetCode 69 Sqrt(x) (Binary Search)
A typical binary search problem, I tried two approaches of how we handle the floor/ceil problem, they have subtle difference, one advice is that we should always keep the final right answer within our range, so that when i meets j, that is just what we want, and no edge cases needed to be checked

Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode online. If you are interested, maybe we can learn together.
Рекомендации по теме
visit shbcf.ru