Binary Search: Top 6 must do problems

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

In this video, I will discuss some interesting problems on binary search which are usually asked in coding interviews at tech-companies for SDE roles.

You can easily expect atleast 1 problem similar to these asked to you in your interviews.

Make sure to like the video, share with your coder friends and subscribe to my channel for more quality content!

Enjoy Watching!
Super useful books for algo ds and programming fundamentals!

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

Kartik: Clickbait infinity
Me: Boht Tej ho gye ho😁😉😉

jashanbansal
Автор

sir pls cover more topics like u did "6 must do problems" for binary search pls do for recurssion, do, graph and explain each too as ur explanation is very grt

coder
Автор

In 1st question we have to also check if l == r whenever a[mid] == x.
else loop run infinitely.

bharatlakhera
Автор

need this type of video for most of the topics like DP, DFS, BFS, Greedy, Tree, Graphs algos, Maths, sliding window, 2 pointers, DnC, Bitmasking etc.
Plzz try to make a series/playlist of MUST do questions only( no editorials) of all Important topics so as a beginner we can get good selected problems to practice topicwise, in a right way, to understand Algorithms better.

mastermind
Автор

Best content on YouTube on binary search

shatabhishekbaidya
Автор

So in many interviews the focus on sliding window approach. Could you similar to binary search help us with few different problems in Sliding Window. How we recognize it and implement it. :)

sanskritisinghal
Автор

The 1st problem is pretty much Leetcode 34 1st & Last Position of element in Sorted array.

zaidshaikh
Автор

If the target value is not in the given array the algorithm returns 1, which should be 0.

Solution :-
Considering the edge case of the binary search to be -1, use the following algo -

IF ---> (start_position AND end_position < 0)
THEN ---> return (end_position - start_position)
OTHERWISE ---> return (end_position - start_position + 1)

jeffkirchoff
Автор

Please teach graph next in the same way you taught DP.🤘

gopal
Автор

Please include cpp code so that beginners can understand as well!🙏

ashwinvarma
Автор

You should also provide the link for the questions in the description

putintruelobe
Автор

How can we handle corner cases when mid is at n-1 where n is length of array? Can I use circular array implementation like we use in queue (mid+1)%n

rohangupta
Автор

Can we use lower and upper bound in interviews?

_ritikkumar
Автор

In the first problem, when a[x]==mid shouldn't the search space change to [low, mid-1], if it is [low, mid] the program might get stuck in an infinite loop ??

nidhigupta
Автор

Will u come up with searching and sorting problem categories editorial from CSES problem set?

prodiptamondal
Автор

what happens if there are equal numbers in the second question and they at pivot of rotation....

surajsri
Автор

Thanks for the video sir....please make more videos of this type on other topics also...

paragroy
Автор

Randomized Binary Search Algorithm may please prepare a video on this

divyashahi
Автор

Can we just binary srch the min ele in 2nd que?

gurharpartapdhaliwal
Автор

I follow you regularly sir. Congrats on being one of the top coders in India. Could you start a telegram channel? Wanna learn a lot from you
From a 3 🌟 coder wanting to achieve 5 🌟 ..

SoumikNandi