LeetCode First Bad Version Solution Explained - Java

preview_player
Показать описание


Preparing For Your Coding Interviews? Use These Resources
————————————————————

Other Social Media
----------------------------------------------

Show Support
------------------------------------------------------------------------------

#coding #programming #softwareengineering
Рекомендации по теме
Комментарии
Автор

why midpoint = (left+right)/2; is not correct but midpoint = left + (right - left)/2; is correct?

rudreshgowda
Автор

Is there a way to do this thing of "left == right" with a typical binary search RECURSIVE?

darod
Автор

this sol gives tle on leetcode. please correct the sol using a variable and store the bad version. so that at last we dont have to call api again

manojpatidar
Автор

Lets say we have 100 versions and first 60 is good, 61. version is bad in this case this loop cant terminate itself. Can you explain me please? thx

t_oguz