another day, another person's semester you just saved
@MichaelSambol2 жыл бұрын
Boom! Awesome.
@masterhimanshu84677 ай бұрын
Lmao I am having my practical today and I am doing this now... That too without laptop... 😂 And I have to do it in C language lol
@harshvardhansingh5507 Жыл бұрын
CS UG student here, you are precise and to the point which makes you different from rest of the creators
@MichaelSambol Жыл бұрын
great to hear!
@NeerajSamshette Жыл бұрын
Best video on binary search I've found, straight to the point with well made animations. Thanks a lot Michael!
@nalskipper7447 Жыл бұрын
Thank you for using a black background and white text. All of your older sorting algorithm videos were really helpful.
@MichaelSambol Жыл бұрын
you're welcome, thanks for watching!
@amitos1646 Жыл бұрын
Damn. I am commenting a bit late but man it's people like you who help me keep on coding and not giving up. Thank you! Amazing content.
@MichaelSambol Жыл бұрын
Thanks bro! Keep going 💪🏼
@duelingo87315 ай бұрын
u r singlehandedly making algorithms easy for people keep it upppppp
@glenn7422 Жыл бұрын
such a great explanation, I love your calmness
@MichaelSambol Жыл бұрын
thank you!
@BirukBelayneh-rq2we3 ай бұрын
damn, this is amazing and exactly what i wanted as a python beginner currently. thanks Michael
@sudhirms6507 Жыл бұрын
Ur the goat bro I just watch ur vids 1 hr before the exam and covered the entire 5 months syllabus ,🔥🔥
@theanamex99692 жыл бұрын
Your code is so simple and easily understandable, it helped a lot. My professor had 3 slides on it, very yuck. Thank you so much!
@DavidZapata-q4n8 ай бұрын
I watched previously the video where you explain the Big-O Notation, in it you showed ant the end that in a "IF -> ELSEIF -> ELSE" the time complexity would be O(n^2). At 2:47 there was an "IF -> ELSEIF -> ELSE" why is the time complexity in this case O(log n) and not O(n^2)?
@MichaelSambol8 ай бұрын
Might be helpful to watch the whole playlist on analyzing algorithms: kzbin.info/aero/PL9xmBV_5YoZMxejjIyFHWa-4nKg6sdoIv
@Neb_Explains Жыл бұрын
0:35 generally it will be rounding down since int always kind off round down by default in more languages
@Anonymous-ri4mk5 ай бұрын
Oh this makes it so much easier i was watching the visualisation but i just get confused lol since i am not very perceptive thank you this helps a lot
@Czarcasm.7 ай бұрын
reviewing for a data structures quiz rn, this was exactly what i was looking for! 💪very clear and helpful explanation :3
@hojongyu8243 Жыл бұрын
Amazing explanation. Thank you!
@yorgodev2 жыл бұрын
Cool stuff Michael! Keep up the great work!
@okok-sc2cx2 жыл бұрын
Please please please keep making videos, I watch your videos everyday, you make my day, thank you
@MichaelSambol2 жыл бұрын
More coming! 4 weddings in October stalled my progress. Thank you for watching!
@ZandalfBunt2 жыл бұрын
@@MichaelSambol 4 wives? As expected of Mr. Sambol.
@anirudh49462 жыл бұрын
Nicely explained!
@MichaelSambol2 жыл бұрын
thank you! I appreciate you watching.
@t_ahmad2 жыл бұрын
Great Explaination! Could you make a video on Linear Search is well? :)
@SunsetsOverBatteryCity8 ай бұрын
Him: “quick sort=pivot” Me: “WHILE HE HID IN RADIO WE PIVOTED TO VIDEO 🗣️💥”
@eliyoung94068 ай бұрын
Bro is actually a godsend
@enebenzer-p6t7 ай бұрын
can you make one on linear searches
@techytech07 Жыл бұрын
Just a quick question, after finding the average of index, if that mid position happens to land on the target index, does the search stop and the target is found?
@MichaelSambol Жыл бұрын
yep. see code here: github.com/msambol/youtube/blob/master/search/binary_search.py
@techytech07 Жыл бұрын
@@MichaelSambol Great! thanks a lot
@jakubrembiasz89427 ай бұрын
amazing video keep it up!
@Jkauppa Жыл бұрын
hey, try median bucket sort, its 2n log n, ie, first linear median search O(n) then split the elements to two buckets, repeat for sub-buckets
@sweetphilly2 Жыл бұрын
Curious if it would behoove the algorithm to check if either left, right, or mid is the answer
@ziyad77802 жыл бұрын
i like your explanation:) keep it up
@vraimoi7 ай бұрын
great vid man keep it up
@doodle_mo_ka4336 Жыл бұрын
bro should be known by more people
@magma65542 жыл бұрын
you are a legend
@MrBurn666 Жыл бұрын
Whats the purpose of returning specifically -1 if the target value is not found? Why not simply state that the target wasnt found?
@MichaelSambol Жыл бұрын
Can do either :)
@nurpaujiana46643 ай бұрын
thanks bro, iam understand now
@stutipande2542 Жыл бұрын
why do we return -1?
@MichaelSambol Жыл бұрын
returning -1 if key is not in the array. otherwise return the key: github.com/msambol/dsa/blob/master/search/binary_search.py#L9
@rain_yy9 ай бұрын
nice explanation but how do i know the time complexity?
@rain_yy9 ай бұрын
do i calculate or something? hehe
@MichaelSambol8 ай бұрын
Take a look here, this should help: kzbin.info/aero/PL9xmBV_5YoZMxejjIyFHWa-4nKg6sdoIv
@rain_yy8 ай бұрын
thank you Sir !! @@MichaelSambol
@jwinwithin51247 ай бұрын
what if the number 29, how will it work
@MichaelSambol7 ай бұрын
Try it here :) github.com/msambol/dsa/blob/master/search/binary_search.py
@migy220Ай бұрын
can someone explain to me why the average of (0,13) = 6 , average of (0,5) = 2? thank you!
@MichaelSambolАй бұрын
Rounding down
@nerfornada- Жыл бұрын
THANK YOU
@kafychannel Жыл бұрын
thank you so much !
@ZFlyingVLover2 жыл бұрын
These search routines are canned so you can just grab them and use them
@folklore6270 Жыл бұрын
lifesaver
@zea74522 жыл бұрын
Why not return array[mid], why return mid I don't understand
@MichaelSambol2 жыл бұрын
The code returns the index/location of the element you're searching for: github.com/msambol/youtube/blob/master/search/binary_search.py.
@maxheinwal508410 ай бұрын
if you return array[mid], you would return the number you are looking for, because mid is the index of the wanted number.
@bossmusa9075 Жыл бұрын
thank you
@VitorRaimundo1710 Жыл бұрын
👏👏
@head-lag2 жыл бұрын
niceeee
@kobey3044 Жыл бұрын
There are 14 numbers in this LIST.. so Average should be (0,14)=7
@MichaelSambol Жыл бұрын
It's by index in the array... so 0 and 13. See code here: github.com/msambol/dsa/blob/master/search/binary_search.py