Video není dostupné.
Omlouváme se.

BS-1. Binary Search Introduction | Real Life Example | Iterative | Recursive | Overflow Cases

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • Problem Link: bit.ly/41Tk8ql
    Notes/C++/Java/Python codes: takeuforward.org/data-structu...
    Full Course: bit.ly/tufA2ZYt
    You can follow me across social media, all my handles are below:
    Linkedin/Instagram/Telegram: linktr.ee/takeUforward
    0:00 Introduction
    1:27 Real Life Example
    5:18 Coding Problem Example
    13:22 Iterative Binary Search Code
    17:15 Recursive Binary Search Code
    26:18 Time Complexity Analysis
    29:12 Overflow Case
    32:46 Outro

Komentáře • 239

  • @takeUforward
    @takeUforward  Před rokem +97

    Please comment understood and give us a like if you got everything :)

    • @sabyasachibiswal7790
      @sabyasachibiswal7790 Před rokem +2

      Sir if possible can you please make a series on sliding windows ,2 pointers after this

    • @sabyasachibiswal7790
      @sabyasachibiswal7790 Před rokem +2

      Salute to your dedication sir

    • @Demodulator7
      @Demodulator7 Před rokem +2

      ​@@sabyasachibiswal7790 as he is following the a2z sheet so i think next will be on string. Sliding window is on step 10 so it will take time i think.

    • @dhruvsharma9230
      @dhruvsharma9230 Před rokem

      now 2023 c++ , pls dont skip java , again saying refactor entire sries java , tell me bench how many projects u get C++

    • @dhruvsharma9230
      @dhruvsharma9230 Před rokem

      all people now doing dsa java foregt C++ in next 2 years recession

  • @playtune9217
    @playtune9217 Před 10 měsíci +33

    This guy does amazing work. If I can grasp it, anyone can follow this playlist. thanks man.

  • @Slice32gaming
    @Slice32gaming Před 10 měsíci +7

    bhoat sahi bro masta kaam kar raha hai tu .jo loag course afford nahi kar shakte unko free maine sikha raha .India need people like you

  • @CodePinaka
    @CodePinaka Před rokem +44

    "Raj" may be not in dictionary, but one thing is sure that "Raj" is in our heart :)

  • @utkarshshrivastava2632
    @utkarshshrivastava2632 Před rokem +15

    Loved the way how you always keep your promise and deliver premium quality content ! Hats off to the dedication man❤❤❤❤

  • @vikasbagri1225
    @vikasbagri1225 Před rokem +23

    Understood it very well
    And the OVERFLOW part was awesome
    Keep up the good work Striver
    Although you have promised us 30+ videos but no worries as we know how busy you are
    Once again thanks for this amazing series

  • @harshith1424
    @harshith1424 Před rokem +172

    Bro dropped whole" binary search" album overnight 😂😂😂

    • @emtiazahmed5333
      @emtiazahmed5333 Před rokem +10

      😂😂😂😂 sahi bola..bhaiya is on fire😂

    • @takeUforward
      @takeUforward  Před rokem +76

      Sorry pura nai ho paaya as website ka kaam chal raha tha, pura aa jaega 5/6 din me

    • @roshanraturi1040
      @roshanraturi1040 Před rokem +12

      ​​@@takeUforward bhya aap itna v kr rhe houtna hi bhoot h ❤

    • @surajpadihar5027
      @surajpadihar5027 Před rokem +13

      Bcz he promised and he never forget his promises that why we love him ❤

    • @harshith1424
      @harshith1424 Před rokem +15

      @@takeUforward arey bhai mai tho mazak kar Raha tha ....u r doing next level hardwork for students.... always thankful to you🙏

  • @cinime
    @cinime Před rokem +1

    Understood! Amazing explanation as always, thank you very very much for your effort!!

  • @nilesh69420
    @nilesh69420 Před 4 měsíci +4

    26:03 Just a small correction at line 6. It should be mid - 1 instead of high - 1. I checked in striver's website and it is correct there. Also, Excellent explanation as always.

  • @priyankarai7917
    @priyankarai7917 Před rokem +3

    Amazing explaination sir ...first time i watch your video ...clear the binary search..

  • @Harsh06g
    @Harsh06g Před rokem +6

    Hats OFF to you bhaiyaa for providing us with much of premium quality content( Don't have words to say for your efforts)
    Thank you so much

  • @rajeshkumarsahoo1257
    @rajeshkumarsahoo1257 Před rokem +1

    Hats OFF to you Man.Thanks for gifting us an Amazing Playlist Like DP.❤❤❤❤❤❤

  • @bhumithakur9967
    @bhumithakur9967 Před 10 měsíci +3

    Striver the way you teach is exceptional 👏 .

  • @user-cx4mh7sc2j
    @user-cx4mh7sc2j Před 8 měsíci +1

    Thank you so much for this wonderful video session and this is the first time i have clearly understood about the concept and it is very clear. Thank you

  • @rishabh1S
    @rishabh1S Před 11 měsíci +2

    Wow the best explaination!! Thanks Striver.

  • @user-yl4cs3qe6r
    @user-yl4cs3qe6r Před 11 měsíci +2

    Hats OFF to you Man for making such Content

  • @johndurai2226
    @johndurai2226 Před rokem

    striver you are very loyal person because you told this video will be post jun 1st .Thank you for the Video for us. Keep doing .

  • @tanya8353
    @tanya8353 Před 7 měsíci

    Your dedication is commendable Striver!!! Great job dude!!

  • @CodeMode9313
    @CodeMode9313 Před rokem

    Understood .... thank u so much bhaiya ...its the best i have ever seen ...salaam rocky bhai

  • @rajatyadav3949
    @rajatyadav3949 Před rokem

    great BS Content i had watched all conceptual Dout's are clear!!

  • @tanishkarawat5266
    @tanishkarawat5266 Před rokem

    Striver bhaiya ka dedication!!!!! Thanks a lot

  • @NandakishorGudala
    @NandakishorGudala Před 10 měsíci +1

    understood i was new to lb, ub floor ,ceil ,i learnt them here .Thanks

  • @user-ie3lx2zc2n
    @user-ie3lx2zc2n Před rokem

    maja aagaya bhaiya wait kar rahe the bahut din se

  • @nopecharon
    @nopecharon Před rokem +3

    Thank you striver for the amazing videos.

  • @suryasaipalthi
    @suryasaipalthi Před 2 měsíci

    Understood. Crystal clear.

  • @user-ot1rd8hd3d
    @user-ot1rd8hd3d Před 11 měsíci +1

    Understood it very well
    THANK YOU SO MUCH SIR

  • @jappanjotsingh9465
    @jappanjotsingh9465 Před 10 měsíci

    LOVED ITACHI NOTEBOOK :)

  • @hareshnayak7302
    @hareshnayak7302 Před 4 měsíci

    Understood, thanks striver for this amazing video. Really enjoing your lecture videos.

  • @div0826
    @div0826 Před měsícem

    You are just amazing. Please keep this good work going

  • @user-rf7ri9pw9p
    @user-rf7ri9pw9p Před rokem

    Thankyou thank you was waiting for this eagerly.

  • @anuragsingh8910
    @anuragsingh8910 Před rokem +43

    0:00 Introduction
    1:27 Real Life Example
    5:18 Coding Problem Example
    13:22 Iterative Binary Search Code
    17:15 Recursive Binary Search Code
    26:18 Time Complexity Analysis
    29:12 Overflow Case
    32:46 Outro

    • @takeUforward
      @takeUforward  Před rokem +13

      Thank you so much

    • @anuragsingh8910
      @anuragsingh8910 Před rokem +1

      @@takeUforward Welcome ❤

    • @iWontFakeIt
      @iWontFakeIt Před rokem +3

      ​@@takeUforward completed same day

    • @sujitrishikumar8621
      @sujitrishikumar8621 Před 10 měsíci

      @@takeUforward bhaiya ek question hai ......at the end of video aapne kaha ...INT MAX + INT MAX ...which is 2*INT MAX.......bhaiya kya yeh kisi variable me store hoga...then divide by 2 hoga........
      agr aisa hoga tabhi na bhaiya overflow condition aayega....isem thora sa confusion hai bhaiya...please clear kar dijiye na bhaiya

    • @IT___AbhayGupta
      @IT___AbhayGupta Před 6 měsíci

      ​@@sujitrishikumar8621INT MAX + INT MAX .... Which is 2*INT MAX , dono variable int type ke hai to int hi output aayega esa compiler samjhta hai, and int type ka memory block provide krta hai output store ke liye, but jb two int max ko add krege to vo int memory block mai store nhi ho payega jisse overflow condition aayegi ,
      And variable mai store nhi ho raha hai , jb program ram mai aata hai run krne ke liye tabhi program ko memory milti hai , kitni memory lgne wali hai program ko or kaha lgne wali hai ye compile time pr decide ho jata hai

  • @pulkitjain5159
    @pulkitjain5159 Před rokem

    Waiting for the solution of Minimizing the maximum distance to gas station. Amazing series and thanks for the signIn / signUp functionality on the site really solved my problem

  • @user-ke7fs7ds6h
    @user-ke7fs7ds6h Před 7 měsíci

    awesome videos, best dsa videos ever

  • @sabyasachibiswal7790
    @sabyasachibiswal7790 Před rokem

    Salute to your dedication

  • @AbhinavPundhir
    @AbhinavPundhir Před rokem

    Thanks bhaiya for all the hard work that you have put, now I am going to watch it😁

  • @RaviKumar-sn6tu
    @RaviKumar-sn6tu Před 3 měsíci

    crystal clear explaination✨✨✨✨

  • @shashipreetham5575
    @shashipreetham5575 Před rokem

    Salute for ur dedication...

  • @aakashsharma780
    @aakashsharma780 Před rokem

    Thanks you Striver bhaiya You made it 🙌🙌 🎉

  • @Manishgupta200
    @Manishgupta200 Před rokem

    Good understanding with TC

  • @sridharshree3034
    @sridharshree3034 Před 6 měsíci

    Awesome thank You Vikram

  • @Raj-pi1pl
    @Raj-pi1pl Před rokem +1

    Finally worth waiting

  • @ritikmalviya2580
    @ritikmalviya2580 Před rokem

    Thanks bhaiya bhot time se intezar tha ❤❤❤

  • @TheNStranger
    @TheNStranger Před 4 měsíci

    that's a great job bro. i like your every video after watching and submit question on leetcode😊😊 .

  • @kingbadshah452
    @kingbadshah452 Před 6 měsíci

    understood everything thanks striver

  • @nehathakur40
    @nehathakur40 Před rokem

    Well explained!

  • @shrad6611
    @shrad6611 Před 8 měsíci

    great playlist

  • @sarangkumarsingh7901
    @sarangkumarsingh7901 Před 2 měsíci

    Awesome bhaiya.................

  • @infernogamer52
    @infernogamer52 Před rokem +1

    Understood Bhaiya!

  • @ritikarora108
    @ritikarora108 Před 6 měsíci +7

    There was a mistake in your recursive code while submitting on Coding Ninjas, in the else statement you have written bs(nums,low,high-1,target) instead of bs(nums,low,mid-1,target), so it won't be O(logn) time complexity.

  • @NazeerBashaShaik
    @NazeerBashaShaik Před 3 měsíci

    Understood, thank you.

  • @abhishekjha9284
    @abhishekjha9284 Před rokem

    striver bhaiya Always on fire🔥🔥🔥🔥🔥🔥

  • @raZer.7_
    @raZer.7_ Před 3 měsíci

    Great video❤

  • @komalkrishna7836
    @komalkrishna7836 Před rokem +4

    Wow 😍 great explanation Striver 👏

  • @prabhakaran5542
    @prabhakaran5542 Před 5 měsíci +1

    Understood ❤

  • @niteshshrivastav5424
    @niteshshrivastav5424 Před rokem

    amazing bhaiya...

  • @dpxy1599
    @dpxy1599 Před 10 měsíci

    example was excellent.

  • @RumanaIslam-xs9rw
    @RumanaIslam-xs9rw Před 25 dny

    This is the best Binary Search explanation I have ever come across, Love from a lost cs soul

  • @sujalGhorse-xh8bs
    @sujalGhorse-xh8bs Před 4 měsíci +6

    Why sound is not there?

  • @kavyasree9760
    @kavyasree9760 Před rokem

    you are amazing..........

  • @user-lr1xb1nu1q
    @user-lr1xb1nu1q Před 8 měsíci

    Please @takeuforward
    Make such more playlist on every topic please

  • @DeboleenaMukherjeeM23CSA008

    Thank you Striver😇

  • @_hulk748
    @_hulk748 Před 7 měsíci

    Understood Sir🙇‍♂🙏✨💖

  • @YourCodeVerse
    @YourCodeVerse Před 7 měsíci

    Understood✅🔥🔥

  • @selene8721
    @selene8721 Před 3 měsíci

    Thank you so much!!

  • @dayashankarlakhotia4943

    Good explanation

  • @abhaymandal4903
    @abhaymandal4903 Před 10 měsíci

    First i like button , then i watch ❤

  • @harshdiwase1941
    @harshdiwase1941 Před 5 měsíci

    very good lecture

  • @uno_u
    @uno_u Před rokem

    Thank you so much :)

  • @user-is6ky7pp2n
    @user-is6ky7pp2n Před 2 měsíci

    Understood !! 😎😎

  • @coderhumai
    @coderhumai Před rokem

    Thank you❤❤

  • @saritakumari4787
    @saritakumari4787 Před 11 měsíci +2

    @takeUforward Hi Raj, shouldn't we also add a condition to check if arr[low] or arr[high] is equal to target. just to save some iterations or stack calls, i know the time complexity would still be log n, but is it advisable to add such optimizations or not ?

  • @apratimghosh5707
    @apratimghosh5707 Před 10 měsíci

    bruhh you're goated🐐

  • @per.seus._
    @per.seus._ Před 11 měsíci +1

    UNDERSTOOD

  • @harshverm776
    @harshverm776 Před 6 měsíci

    Thank you !!!

  • @shaurya2608
    @shaurya2608 Před rokem +6

    I completed the Binary search questions on my own, but I'm having a lot of trouble with the String problems.

  • @sibiranganath
    @sibiranganath Před 4 měsíci

    Underdstood

  • @Rahul_NIT_JAIPUR
    @Rahul_NIT_JAIPUR Před 10 měsíci

    thank you so much bhaiya

  • @soumiyamuthuraj3516
    @soumiyamuthuraj3516 Před měsícem

    Awesome

  • @bhavya8608
    @bhavya8608 Před rokem

    understood!!

  • @Hipfire786
    @Hipfire786 Před 2 měsíci

    understood everything

  • @user-zy4hl5pi7q
    @user-zy4hl5pi7q Před 7 dny

    outstanding

  • @ashishpradhan6250
    @ashishpradhan6250 Před 2 měsíci

    God level🛐

  • @saileela3
    @saileela3 Před 8 měsíci

    Thank You

  • @growmoreyt4192
    @growmoreyt4192 Před rokem

    completed first vide.

  • @AbhishekKumar-cv1dh
    @AbhishekKumar-cv1dh Před 10 měsíci

    Understood!!!

  • @StellarStream9154
    @StellarStream9154 Před 11 měsíci

    understood🤩

  • @harshitjaiswal9439
    @harshitjaiswal9439 Před 6 měsíci

    Understood!

  • @deepanshutibrewal386
    @deepanshutibrewal386 Před rokem +6

    Please give us Sliding Window Playlist . It is very very important and it is not available anywhere.

    • @CodeMode9313
      @CodeMode9313 Před rokem +2

      u can also see for the aditya verma for sliding window ...its also good

  • @Ayeshasingh720
    @Ayeshasingh720 Před měsícem

    thank u so much

  • @humanity7880
    @humanity7880 Před rokem

    understood!

  • @culeforever5408
    @culeforever5408 Před 9 měsíci +1

    understood ;)

  • @utsavseth6573
    @utsavseth6573 Před rokem

    Understood.

  • @bhavyasharma3500
    @bhavyasharma3500 Před rokem

    Striver sir jo bolte h vo kr k dikhate h , thanks ❤❤

  • @AyushKumar-ol5jp
    @AyushKumar-ol5jp Před rokem

    Bhaiya binary search ko too chamka diye hoo💥

  • @abhay9994
    @abhay9994 Před 9 měsíci +1

    00:07 Binary search is a searching algorithm in a limited search space.
    02:13 Binary search is a search algorithm applicable in a sorted area.
    06:36 Binary search helps to reduce time complexity in searching.
    08:37 Binary search trims down the search space by splitting it into halves.
    12:59 Binary search works by dividing the search space between low and high and narrowing it down until the element is found or the search space is exhausted.
    15:03 Binary Search is a simple and efficient searching algorithm.
    19:01 Binary search is a recursive algorithm that repeatedly halves a sorted array to find an element.
    20:50 Performing binary search using recursion and base case handling
    24:39 The video explains how recursion works in binary search.
    26:27 Binary search reduces the search space by half in each step.
    30:27 Binary search can cause overflow when the search space becomes small and the low value reaches the maximum integer value.
    32:35 Binary search Overflow case explained

  • @mrsttechno5974
    @mrsttechno5974 Před 10 měsíci

    understand😍💪

  • @nayankhuman1043
    @nayankhuman1043 Před 16 dny

    Understood :)

  • @himanshukaushik9223
    @himanshukaushik9223 Před rokem

    Thanks bhaiya

  • @PRALAY.THAKUR
    @PRALAY.THAKUR Před 11 měsíci

    great

  • @shibsankarpramanik768
    @shibsankarpramanik768 Před 8 měsíci +1

    GOAT 🐐 of DSA