Introduction to Binary Search (Data Structures & Algorithms #10)

Поділитися
Вставка
  • Опубліковано 27 чер 2024
  • Here’s my introduction to the binary search algorithm.
    Check out the practice problem from algoexpert.io/csdojo at 12:17.
    You can find my Python and Java sample code at: www.csdojo.io/binary
    Also join our community at: www.csdojo.io/community

КОМЕНТАРІ • 282

  • @CSDojo
    @CSDojo  3 роки тому +46

    If you’re already familiar with binary search, I’d recommend the practice problem I introduced at 12:17.
    It’s a nice problem from my business affiliate algoexpert.io/csdojo - from which you can get a discount with my referral code csdojo.

    • @Ali-mc4le
      @Ali-mc4le 3 роки тому +3

      What is the blackboard app or tool you are using to show code examples? Looks great!
      I just joined algoexpert because of you :)

    • @htol78
      @htol78 3 роки тому +2

      +1 what software do you use to create presentation? looks pretty good.

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

      Hello dojo thank you

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

      def search(arr, target):
      l = 0
      r = len(arr)-1
      while l arr[r] and target < arr[m]:
      r = m-1
      else:
      l = m+1
      return -1
      right?

  • @tylerdurden4169
    @tylerdurden4169 3 роки тому +167

    Continue this series of data structures.

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

      would be great!

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

      Check out apni kaksha for ds and algo

    • @acm1812
      @acm1812 3 роки тому +9

      @@lakshkaushik6366 no

  • @prernacore
    @prernacore 3 роки тому +10

    please continue this course. it's the best that I have ever stumbled upon. Been watching all the videos since morning and I am so grateful for these , cleared all the doubts and making basics easier and clear. Thank you!

  • @ctcrnitv
    @ctcrnitv 3 роки тому +10

    You are such a good teacher. I already knew what binary search was but this was brilliantly explained, probably the clearest explanation I've ever seen.

  • @TheNaderpop
    @TheNaderpop 3 роки тому +2

    Man, how do I love your introduction to this series so much
    ,
    I hope you finish this series as soon as possible.

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

    It's not obvious how much binary search helps until you actually code it and time it yourself. It's actually amazing. Thanks for the informative videos!

  • @manuelelkess8259
    @manuelelkess8259 3 роки тому +46

    This course of data structures and algorithms one of the best on the internet I really hope you continue it to the very end.

  • @williambasquez7607
    @williambasquez7607 3 роки тому +16

    Back at it again with the good stuff 👨🏻‍💻💻

  • @dreamofmirrorsguy7043
    @dreamofmirrorsguy7043 2 роки тому +3

    You are insanely the best pragmatic youtuber and teacher I've watched so far. Thank you very much for your content!

  • @mattoattacko
    @mattoattacko 3 роки тому +9

    Heck yeah! You totally came through. Much appreciated mate!

  • @Veigaburame
    @Veigaburame 3 роки тому +6

    the way you seperate exercise into 10-15 minutes is pretty handy. I could spend time watching your video while having lunch. Love to see these kind of videos uploaded on UA-cam. Thanks Dojo hehee

  • @SarangDhanurdhari
    @SarangDhanurdhari 3 роки тому +2

    Thanks a lot dojo. Please keep continuing this series.

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

    The way you explain the process of thinking about the problem is really good. While you are explaining the problem I can already imagine the code required to solve it. Your videos have helped me a lot to conceptualize solutions to my problems.. so thank you very much!

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

    Reaaly great explanation! Thank you very much and continue these series!

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

    Thank you so much for this great opportunity to Learn Dara structures and Algorithm with you.

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

    Dojo, man this was a crystalclear explanation. Thank You very much.

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

    these videos are a godsend. very well articulated! keep it up! i look forward to more videos in the series!

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

    Hello CS Dojo!!!. I am so happy for the new video!!!

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

    THANK YOU! for saving me always. Your tutorials are easy to understand compared to others. Great teacher!

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

    This is so helpful. Thankyou and please continue this series :)

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

    Really looking forward to your next videos in this series!

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

    Love this video. Great Refresher!!!

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

    Very clear explanation, thank you very much! Please keep them coming

  • @lysekthe
    @lysekthe 3 роки тому +2

    I applied this algorithm in my work, thank you!!!

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

    This is no joke one of the best videos ive watched, I do not comment on youtube videos, but this deserves one.
    Thank you

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

    Great video with a lot of information. Thank you for all!

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

    I'm not gonna lie, it is still hard to wrap my head around some of this stuff like time complexity and Big O.
    Thank you for all that you do!

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

    Nice explanation! Searching Algorithms are super interesting and important :)

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

    Thanks. I was waiting for this video ! Please continue DS and Algo Series

  • @anuragd398
    @anuragd398 3 роки тому +2

    Back at it again with the good stuff YK

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

    5 years i couldn't understand about complexity until now! thanks

  • @udoyonb274
    @udoyonb274 3 роки тому +2

    This is brilliant! Thank you so much!

  • @dailycodingproblem8346
    @dailycodingproblem8346 3 роки тому +30

    I’m 4 days away from turning 93 and CS Dojo inspired me to create my own tutorials. Thanks, CS Dojo!

    • @stevepriest5113
      @stevepriest5113 3 роки тому +2

      Happy birthday

    • @shubhamiot326
      @shubhamiot326 3 роки тому +2

      @@stevepriest5113 I advance

    • @Name-mi7bx
      @Name-mi7bx 3 роки тому +3

      Fake, not the first time a simp Commented the same shit.

    • @Importunity
      @Importunity 3 роки тому +8

      you did not sound like you were turning 93 in your video bruh

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

    Good stuff❤... Continue all concepts related to data structures.

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

    this is a great refresher!

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

    Great teaching and it was very fun to learn!

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

    Finally he is back with this series

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

    I like your explanations and I'd love if u make more videos like this

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

    Thanks for your help! These videos are amazing!

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

    Best explanation I found on YT! thanks!

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

    Your videos are really helpful ! continue your good work .

  • @p_square
    @p_square 3 роки тому +2

    Legend back again!!

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

    The best programming lessons on UA-cam!!

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

    Thank you so much CS Dojo

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

    Clean explanation! Thank you so much!

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

    Wow.. thank you for this tutorial. I badly needed this one

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

    i am very very very happy to see you again. you are the best for explaination

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

    Quality content as always.

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

    You just made it so simple!
    Thanks

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

    You are my saviour!!!!! thank you so much. i was having so much trouble with this

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

    You're great. The explanations are really broken down. Thank you👍

  • @KevinGarcia-ws1kt
    @KevinGarcia-ws1kt Рік тому

    Thank you for this video. That was a really clear explanation

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

    Thanks a lot for such a great video... Well explained easily understandable

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

    My idea for shifted binary search: Copy the array once, so that an array like [3,1,2] becomes [3,1,2,3,1,2]. Next, we compute the maximum and minimum values of our original array, which are 3 and 1, respectively. Then, we run 2 pointers to find the indices of the range between the minimum and maximum, which in our example the indices are 1 and 3, and we binary search through those values.

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

      Never mind, I watched the Errichto video on this. Rip I got this wrong

  • @shubhamiot326
    @shubhamiot326 3 роки тому +2

    Keep on making videos... Salute from india

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

    Thank you for sharing this content!

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

    Thanks. The sorted rotated array problem is very interesting

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

    super clear instruction. Thank you.

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

    nice series! please continue

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

    You are quite an inspiring guy. Keep on!

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

    That's so cool, learned a lot. I, myself, for example solved it like following:
    def search(arr,target):
    if target in arr:
    for i in arr:
    if arr[i]==target:
    return i
    print(search([1,2,3,11],11))
    output: 3

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

    such a good explanation!

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

    Great video as always

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

    Thanks csdojo 😊

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

    You are back !!😊

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

    your videos are so helpful, dude. tysm! ;u;

  • @user-vv9lz2ik2t
    @user-vv9lz2ik2t 3 роки тому

    Great explanation thanks

  • @selvalakshmis.v4232
    @selvalakshmis.v4232 3 роки тому

    Fantastic video Thank you

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

    Thank you so much great explanation 👍 pls upload more videos on Data structures.

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

    Please continue the python series. Really waiting for more videos. I have started learning by watching your videos plz do teach more

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

    Thank you so much, you helped me a lot!

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

    great explanation

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

    Thank you so much CS dojo ❤

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

    It would be great if you can share some experience in dealing with conditions in binary search templates, e.g., left < right or left

  • @GhostVaibhav
    @GhostVaibhav 3 роки тому +2

    Bro, increase the frequency of ur videos!! It will be of great help to everybody..!

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

    Thanks for the lesson !. Do you have any video or resource where you list or describe the personal projects you did before you applied for Google?

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

    Welcome back.

  • @neevetiasli
    @neevetiasli 6 місяців тому

    For the first time ever i really understood

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

    Thanku so much sir, I am your subscriber from INDIA✌️😊

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

    You made it so simple.

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

    I am really appreciate your effort CS Dojo. if it’s possible can you make next episode about hash table?
    Peace.

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

    UA-camrs I owe my whole degree: CS Dojo, Code with Harry and Organic Chemistry Tutor .

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

    very good, i like this!

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

    best explanation

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

    Thank you sirr👏👏👏

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

    best lecture👌🏻

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

    Thanks a lot for your effort.
    please make a tutorial on Merge sort algorithm + quick sort algorithm

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

    I Love Your Chnnel So much

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

    I know this is old but what software were you using to create this ?
    Awesome video by the way. I was having trouble understanding the pointer aspect on codecademy but seeing the visuals helped a lot

  • @MrEric-rs2wg
    @MrEric-rs2wg 2 роки тому

    Thank You!!

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

    Please continue 😍🙏

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

    great content

  • @kumaracademy7555
    @kumaracademy7555 3 роки тому +25

    I am your student from India❤

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

    Thanks CS Dojo. The practice problem was fun!
    public static int ShiftedBinarySearch(int[] array, int target){
    int l=0, r=array.length-1, mid=0;
    while(larray[r]){
    mid=(l+r)/2;
    if(array[mid]==target) return mid;
    else if(array[mid]array[mid] && target=array[l] && target

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

    Hey CJ you're videos are very good

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

    Nice Dojo

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

    YK! Kindly do complete this Playlist as I don't wanna wander about different places after already starting your Playlist. Thanks. ~ FAN

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

    Bro please continue this stuff🙏

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

    Nice one👍

  • @trickopedia-vardhanmittal2525
    @trickopedia-vardhanmittal2525 3 роки тому +1

    u are too cool. love u brother