Search in Rotated Sorted Array - LeetCode 33 - JavaScript

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


Step by step walk through of the solution to the popular Microsoft coding interview question, Search in Rotated Sorted Array.

LeetCode 33

JavaScript

0:00 Intro
1:04 Explanation
4:10 Code

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

theres an edge case where the implementation of mid does not work

if you use

let mid = Math.floor((left + right) / 2);

to calculate mid. it will work instead!

Ethan-Johnson
Автор

I dont understand the different ways to calculate mid. Why does one cause stack overflow but in other binary search instances we use it without worry?

fishmisch