What is binary search

Поділитися
Вставка
  • Опубліковано 25 жов 2024

КОМЕНТАРІ • 271

  • @sherumov6472
    @sherumov6472 7 місяців тому +7

    This guy is the best teacher, i watched a lot of teaching videos but this one is really the best

  • @na_you_mess_am
    @na_you_mess_am 7 років тому +272

    Indians are very intelligent people, Thanks, Greetings from Nigeria.

    • @gunjankumar3068
      @gunjankumar3068 5 років тому +9

      @@akshaykumarmishra6535 why so much hate?

    • @SethMtv
      @SethMtv 5 років тому +31

      @@akshaykumarmishra6535 So because you encountered one bad Nigerian you're going to plaster an entire race as bad? You're disgusting and a disgrace to Indians

    • @shivamkumarsuman3924
      @shivamkumarsuman3924 5 років тому +19

      @@akshaykumarmishra6535 shame on you...you can't blame entire community just because of bad deeds of one person.... I am also from India...and I have met several African people ...you can't blame in that way....

    • @akshaykumarmishra6535
      @akshaykumarmishra6535 5 років тому +1

      @@shivamkumarsuman3924 pehli fursat me nikal..... Nikal. ***@#₹

    • @surajdas9407
      @surajdas9407 5 років тому +14

      @@akshaykumarmishra6535 we indian are good in this only, to criticize others.

  • @animeshnayan1
    @animeshnayan1 11 років тому +11

    Although in programming, in most cases we mean recursion as an implementation where a function calls itself,  recursion as a process is reducing a problem to sub-problem in a self-similar manner. Any program that can be written using recursion can be written iteratively as well. In fact , if you write a recursion for binary search, it will be called a tail recursion which will anyway be optimized by compiler to iteration. Thanks for asking :)

  • @MrVee2010
    @MrVee2010 10 років тому +14

    Very clearly presented, thanks for taking the time to make these great tutorials!

  • @pomeraniansandacat2371
    @pomeraniansandacat2371 8 років тому +24

    Thank you so much for the clear explanation! My PH.D professor needs to learn from you on the art of teaching.

    • @nobody2937
      @nobody2937 2 роки тому

      ol ^_^ PhD professors usually speak out non-sense....

  • @digambaringale5806
    @digambaringale5806 2 роки тому

    Superb Explanation. Even after 9yrs I feel this one of the best explanation...

  • @hypein2297
    @hypein2297 3 роки тому +3

    This video will never become old.

  • @sajankumar-xk2vj
    @sajankumar-xk2vj 7 років тому +2

    I am not from computer science background. So i have no idea about Big o(n) complexity. Finally I found your tutorial here. It really helpful. I finally followed your instruction and applied this logic in my application which i am working. It works like charm :)
    //Node js version
    function search (arr, x){
    var start = 0;
    var end = arr.length - 1;
    console.log("Start value:", start);
    console.log("End value:", end);
    console.log("search for x:", x);
    while( start

  • @Scoutorcus
    @Scoutorcus 5 років тому +3

    Thanks for helping me get through cs50! I honestly would have given up if it wasn't for your videos

  • @wuzongye
    @wuzongye 10 років тому +7

    This guy is awesome, very clear explaination

  • @shaunakphatak6338
    @shaunakphatak6338 3 роки тому +4

    Amazing explanation, clear and to the point.

  • @tomjerry997
    @tomjerry997 7 років тому +1

    bro!!... u really made it very clear!!!... i never thought it would be so easy... keep up the good work!!!

  • @786Peacelover
    @786Peacelover 6 років тому +3

    finally i started understanding algorithms :D thanks. I appreciate your effort for helping a lot of students.

  • @zaidtergaon1682
    @zaidtergaon1682 5 років тому +32

    Please do a full featured course on Data Structures and Algorithms and solve around 100+ very popular competitive problems and upload it on Udemy! We will be happy to buy it

    • @dilpreetsinghnagra
      @dilpreetsinghnagra 5 років тому +16

      bro mycodeschool was a startup and it is closed after the death of one of its founder known as Humblefool he was best programmer of India

    • @primroseneog4302
      @primroseneog4302 4 роки тому +2

      @@dilpreetsinghnagra Humblefool GOD

    • @themodestai9603
      @themodestai9603 3 роки тому +1

      He died :(

    • @primroseneog4302
      @primroseneog4302 3 роки тому

      @code fire well i just meant he was Godlike in coding

    • @primroseneog4302
      @primroseneog4302 3 роки тому

      @code fire well he was the greatest in India in competitive programming at least, he ranked 31st in Google Code Jam in 2008, and i don't think any Indian after that have ever got a higher rank than this in Code Jam.

  • @venkat575
    @venkat575 9 років тому +3

    Thanks for the awesome explanation! I watch your videos to gain conceptual clarity.

  • @Sameer5865
    @Sameer5865 8 років тому +58

    I would rate this 10/10. You have a weird accent but everything is clear, and the diagrams are also on point. Keep up the good work man. :)

    • @pdcx
      @pdcx 8 років тому +19

      indian accent for english is the best

    • @dopier12
      @dopier12 7 років тому +28

      Who cares about the accent when a man is smarter than the devil? You only bow to him! I mean in all seriousness, you can't but appreciate the knowledge. I can see why your country is on the move. I thank and salute you!

    • @rigoparis
      @rigoparis 7 років тому +3

      There are captions :/

    • @IvanIvanov-qx5oz
      @IvanIvanov-qx5oz 6 років тому

      he just said that everything is clear

    • @pritibanjegadheson6420
      @pritibanjegadheson6420 5 років тому

      fucvk u

  • @light_clover9636
    @light_clover9636 6 років тому +1

    My fav youtuber...wish I could have you as my lecturer 🤗

  • @nidaunnisa1454
    @nidaunnisa1454 8 років тому +2

    amazing video! understood the best case and worst case scenarios very clearly !

  • @norwill5642
    @norwill5642 11 років тому +3

    Clear, helpful, and thorough.

  • @victor7ultimate
    @victor7ultimate 7 років тому +6

    thank you very much for this tutorial.
    watching it few hours before exams 😂

  • @yatinarora9650
    @yatinarora9650 7 років тому

    the best video for Binary Search algorithm

  • @MexterO123
    @MexterO123 10 років тому +12

    Excellent video! I need this for my test tomorrow! :D

  • @farzanafaizal9047
    @farzanafaizal9047 6 років тому

    THE BEST EXPLANATION SO FAR THANKS DUDE

  • @geovanyteca3250
    @geovanyteca3250 Рік тому

    Outstanding explanation! Simple and very clear

  • @komalrathore5145
    @komalrathore5145 2 роки тому

    very good explaination your teaching skills are very good keep making vedios such like that

  • @fizzahaseen5224
    @fizzahaseen5224 6 років тому

    Very good interpertion. needed for assignment. Thanks from Pakistan.

  • @sanchitsingh7162
    @sanchitsingh7162 7 років тому +2

    This was very well explained.

  • @kid_kulafu_1727
    @kid_kulafu_1727 6 років тому +1

    This gold right here. I have a question though why did you add start and end? Why didnt you do n-1/2?? Thanks!

  • @nishantsakse
    @nishantsakse 2 роки тому +1

    awesome explaination!

  • @M98lm
    @M98lm 8 років тому +3

    Thank you so much! it's pretty laborious to find apt study materials/videos on python.
    This is very well explained...!!!!

    • @JustinZaf
      @JustinZaf 5 років тому

      Do have you learnt python practically in 3 yrs?

  • @saikanamsiam2000
    @saikanamsiam2000 8 років тому +1

    awesome content as always! Fan from Bangladesh!

  • @dennyvarghese1069
    @dennyvarghese1069 5 років тому

    Clear way of explanation.good work.thank you

  • @komjungin7174
    @komjungin7174 7 років тому +1

    thanks mate, it helps a lot for my exam!!

  • @rikampalkar
    @rikampalkar 7 років тому +1

    Very well taught.

  • @AdarshSingh-qd6mq
    @AdarshSingh-qd6mq 3 роки тому

    Thanks for great explanation...

  • @JaiVijai
    @JaiVijai 10 років тому +1

    excellent explanation thanks for giving such type of vedios

  • @alzyl6287
    @alzyl6287 5 років тому

    Very helpful video .... And also it has included the basics at the first

  • @hbibamrani9890
    @hbibamrani9890 2 роки тому

    What a beautiful algorithm♥

  • @095_shaniabalkhi9
    @095_shaniabalkhi9 3 роки тому

    Great Explanation!

  • @mujahidulislam315
    @mujahidulislam315 6 років тому

    It's mycodeschool..Which is the best choice of understanding algorithm...

  • @FictionsAndIllusions
    @FictionsAndIllusions 9 років тому

    12:00 - 12:40 helped explain how binary search is O(log n). Cool stuff, thanks for sharing.

  • @skybo053
    @skybo053 9 років тому +1

    Thank you. Explained very well.

  • @backtotheorigins848
    @backtotheorigins848 6 років тому

    Nice very clear. Best tutorial

  • @abhisheksachdeva9397
    @abhisheksachdeva9397 6 років тому

    Awesome content on this channel.

  • @jessneurismfarmer
    @jessneurismfarmer 7 років тому +82

    Video starts at 4:25, before that is super basic information not regarding binary search,

    • @sumanth5087
      @sumanth5087 5 років тому

      Thanks bro

    • @meltdown6856
      @meltdown6856 4 роки тому

      Thanks man

    • @jonathanharoun5247
      @jonathanharoun5247 4 роки тому

      Bullshit. The beginning emphasizes how the typical method is less efficient. Understanding the reason we use binary search is even more important than knowing how to implement it (because why implement it when you don't have a reason to?)

  • @JustinZaf
    @JustinZaf 5 років тому

    Superb amazing job Lucid explanation

  • @md.shafaatjamilrokon8587
    @md.shafaatjamilrokon8587 7 років тому

    I Like your speaking style!!

  • @sarvanividela1631
    @sarvanividela1631 9 років тому +3

    Can u please upload a video on prims, krushkals, job sequencing algorithms.

  • @perkhaahmad1136
    @perkhaahmad1136 8 років тому

    very very great explanation.

  • @w4h175
    @w4h175 3 роки тому

    great...great as always

  • @aycanocal6506
    @aycanocal6506 3 роки тому

    Great explanation thank you

  • @kevincavner8168
    @kevincavner8168 8 років тому +10

    Excellent video, although i'd explicitly label the first search method as linear instead of having "Binary Search" at the top. It could confuse people who are just starting out, or those that just watch the first example.

  • @madalinajantea4085
    @madalinajantea4085 5 років тому +1

    Thank you so much for this video!! Amazing job!!!!

  • @fengfeng6680946
    @fengfeng6680946 8 років тому

    very good explanation!!!!

  • @KulasangarGowrisangar
    @KulasangarGowrisangar 7 років тому

    A great one! Kudos!

  • @saurabhsinha8779
    @saurabhsinha8779 8 років тому

    tqq.. this video is very helpful.. for us

  • @anjaliroy7851
    @anjaliroy7851 6 років тому

    Thanks it is ver much useful to me

  • @shivaanimahesh5738
    @shivaanimahesh5738 6 років тому

    Yo dude, thanks for the video. It was really helpful

  • @Co0lGwindolyn
    @Co0lGwindolyn 4 роки тому

    Well explained, thank you 🌸

  • @PMBSTUDIOS
    @PMBSTUDIOS 5 років тому +1

    Thanks for uploading ✌🏻🔥

  • @RightMeow28
    @RightMeow28 5 років тому +17

    Always better to do: mid = start + (end-start) / 2;. To avoid overflow.

    • @lustroustub
      @lustroustub 4 роки тому +1

      But simplifying algebraically we’d get Start + End /2. It’ll be equal anyways mathematically.

    • @janisstrods4404
      @janisstrods4404 4 роки тому +1

      @@lustroustub (Start + End)/2 *

    • @AlexandrBorschchev
      @AlexandrBorschchev 4 роки тому +1

      start + (end+start)//2

  • @plasmasheep4098
    @plasmasheep4098 6 років тому

    Best one out there

  • @vishaldubey1228
    @vishaldubey1228 6 років тому

    Thanks a lot buddy, You are really awesome.

  • @wazidullahmurad3644
    @wazidullahmurad3644 7 років тому

    wow, the tutorial is clearso much awesome. everything described nicely.

  • @AnonymousCoder7
    @AnonymousCoder7 Рік тому

    This man is a Legend! Legends Never Die! 🤍

  • @pranavtawade6898
    @pranavtawade6898 10 років тому +1

    Very well explained Binary Search topic..keep up the good work...
    gained new subscriber :)

  • @Vishalbitmca
    @Vishalbitmca 8 років тому

    Nicely explained!

  • @rocker19943
    @rocker19943 8 років тому

    i like your explanation

  • @mrvysakhable
    @mrvysakhable 5 років тому

    Good explanation 👍👍👌

  • @alishatrivedi3170
    @alishatrivedi3170 9 років тому +6

    awsum..i olwz search for ur vidio if i have to understand anything..thankyou

  • @DaveClarkFive
    @DaveClarkFive 6 років тому

    Thank you for the video explanation

  • @maheshkotal4214
    @maheshkotal4214 7 років тому

    very nice presentation ;-) liked to watch

  • @tannmaykala262
    @tannmaykala262 7 років тому

    it was really helpful. thanks to you

  • @rigoparis
    @rigoparis 7 років тому

    probably a noob question... but how does binary search works on an unindexed lists? For example, in class I was given the assignment to integrate binary search in an ordered list that we made which only has the attribute 'length'... In the video I noticed you did A[i], which assumes the array or list has an index... what if I wanted to implement binary search into my unindexed list?

  • @kulantheswaranchristywodsa244
    @kulantheswaranchristywodsa244 7 років тому

    good work buddy!!!!keep it up!!!!

  • @sagarshekhar6296
    @sagarshekhar6296 6 років тому

    Simply awesome

  • @hrithiksonu5836
    @hrithiksonu5836 5 років тому

    Superb Video

  • @SSKKJJ00
    @SSKKJJ00 11 років тому +1

    Hey, have u really used recursion in your code? Although, it solves the purpose iteratively too with O(lgn)....

  • @xtracodez
    @xtracodez 5 років тому +2

    Are your tutorials language inpependent? Thanks for the tutorial btw. :)

  • @sanjeevbharti991
    @sanjeevbharti991 9 років тому

    Nicely explain, thanks buddy

  • @kimi21q
    @kimi21q 11 років тому

    Nice explanation, thank u so much

  • @aakashggujju
    @aakashggujju 3 роки тому

    Excellent 👌

  • @riya97
    @riya97 7 років тому +1

    thankyou sir!!
    you are great..☺

  • @shockwave2477
    @shockwave2477 3 роки тому

    Great video

  • @farhanjamil4081
    @farhanjamil4081 8 років тому

    Great way of teaching (Y)

  • @muthaiahpalaniappan8009
    @muthaiahpalaniappan8009 9 років тому +9

    Nice Explanation.
    But i do have a question, if i have an array like this
    (1,2,3,4,4,5,6,7) and if i'm looking for 4
    What i can do here?
    Thank you

    • @manuj9570
      @manuj9570 7 років тому +3

      Muthaiah Palaniappan First one will be displayed

    • @nemplayer1776
      @nemplayer1776 5 років тому

      @@manuj9570 First one found* will be returned.

  • @abhayrajsingh2057
    @abhayrajsingh2057 10 років тому +1

    Hi ,
    but if the array have duplicates then it should give the output telling positions of indexes , how to make it work for duplicates elements in the array..?

  • @halah1995
    @halah1995 8 років тому

    thanx alot ...U R abest one

  • @ManojKumar-bz7qm
    @ManojKumar-bz7qm 6 років тому

    great tutorial ..thanks

  • @sunainagandra2924
    @sunainagandra2924 8 років тому

    superb sir

  • @sadesl1486
    @sadesl1486 6 років тому

    Wonderful! Thank you

  • @MrTechGeek01
    @MrTechGeek01 10 років тому

    nicely explained.

  • @kirantech3875
    @kirantech3875 7 років тому

    thanks.i understood well.nice....

  • @sujan_np
    @sujan_np 6 років тому

    Wow... Thanks, bro

  • @sunainagandra2924
    @sunainagandra2924 8 років тому +3

    Sir,please teach java aswell ...that would be graet help for me...:)

  • @lravikiran88
    @lravikiran88 8 років тому

    sir is this same logic used in binary search tree....?

  • @princepatel9080
    @princepatel9080 3 роки тому +1

    Best🔥

  • @AshishRp7
    @AshishRp7 9 років тому

    well explained man helpfull

  • @oliverlu3259
    @oliverlu3259 10 років тому

    very good, thanks

  • @anubhavbhai5422
    @anubhavbhai5422 8 років тому +98

    Middle element middle element middle element......... XD