ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

BS-4. Search Element in Rotated Sorted Array - I

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 พ.ค. 2023
  • Problem Link: bit.ly/3OmIp5d
    Notes/C++/Java/Python codes: takeuforward.o...
    We have solved the problem, and we have gone from brute force and ended with the most optimal solution. Every approach's code has been written in the video itself. Also, we have covered the algorithm with intuition.
    Full Course: bit.ly/tufA2ZYt
    You can follow me across social media, all my handles are below:
    Linkedin/Instagram/Telegram: linktr.ee/take...
    0:00 Introduction of Course

ความคิดเห็น • 405

  • @takeUforward
    @takeUforward  ปีที่แล้ว +120

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

    • @redstormthecoder5818
      @redstormthecoder5818 ปีที่แล้ว

      Understood sir! This really cleared my doubt regarding the process the code performed in else part! Thank you sir!!

    • @motivationalquotes8545
      @motivationalquotes8545 ปีที่แล้ว

      Very well Understood sir 😀

    • @sudhanshushekhar4222
      @sudhanshushekhar4222 ปีที่แล้ว

      Understood

    • @utsavseth6573
      @utsavseth6573 ปีที่แล้ว

      Now I clearly know how you got a job at Google.😁

    • @venup2813
      @venup2813 ปีที่แล้ว

      Understood

  • @abhisheksinghmehra9576
    @abhisheksinghmehra9576 ปีที่แล้ว +149

    We never move backward bcoz we have Take You Forward😇

    • @satendra6200
      @satendra6200 ปีที่แล้ว +1

      That's a good one 😁

    • @surendharv795
      @surendharv795 4 หลายเดือนก่อน +14

      little cringe brother.

    • @calisthenics5247
      @calisthenics5247 3 วันที่ผ่านมา

      @@surendharv795 ok so called mature sigma boy

  • @lofireverbz-wy7go
    @lofireverbz-wy7go 11 หลายเดือนก่อน +31

    09:56 seriously i watched this many times to see your expression 😄

    • @yoongicorn7973
      @yoongicorn7973 9 หลายเดือนก่อน +3

      Yeah and The little smile when he continued... so cute ❤

    • @lofireverbz-wy7go
      @lofireverbz-wy7go 9 หลายเดือนก่อน

      that,s nice on which lecture you are currently
      @@yoongicorn7973

  • @chaudharyalisha7175
    @chaudharyalisha7175 9 หลายเดือนก่อน +18

    No wonder how demotivated I was when I saw that question and was looking for a good explanation since last 7 days (no, not even exaggerating). But, this man is love!!! Keep going @Striver :) You're our hope!!

  • @yash-seth
    @yash-seth 10 หลายเดือนก่อน +28

    God tier explanation. I truly can't put in words how easily and clearly you were able to explain a seemingly confusing question!

  • @monstercoder3665
    @monstercoder3665 ปีที่แล้ว +68

    None can compete with this man....!!! Simply amazing 👏. Great Work Striver Bhaiyya
    #DSA ka baap.
    The best thing about you is that you are not paid and spreading knowledge to all the aspirants...

    • @iamnoob7593
      @iamnoob7593 ปีที่แล้ว +3

      I think people should pay for this next level quality content.

    • @shubhamkumar-hx1fb
      @shubhamkumar-hx1fb 9 หลายเดือนก่อน

      @@iamnoob7593 haa...if u wish to.. then plss donate that money to some nearby ngos.

  • @hilal937
    @hilal937 9 หลายเดือนก่อน +6

    I was struggling with Binary search on sorted array for a long time,
    Your key point "Eliminate one half" has cleared my confusion.
    Thank you so much Striver

  • @mehulthuletiya497
    @mehulthuletiya497 ปีที่แล้ว +32

    00:24 Problem statement
    01:06 Example
    01:43 Solution-01 (Linear Search)
    02:21 Solution-02 (Binary Search)
    05:00 Dry-run
    11:42 Pseudocode
    15:17 Code
    15:28 Complexity

    • @epsaepsit4645
      @epsaepsit4645 ปีที่แล้ว +6

      09:56 reaction lol

    • @annusharma4764
      @annusharma4764 ปีที่แล้ว

      Correct

    • @xyzxyz9249
      @xyzxyz9249 11 หลายเดือนก่อน +2

      nalla bc

    • @senseiAree
      @senseiAree 10 หลายเดือนก่อน

      ​@@epsaepsit4645hahahahaha

  • @reyanshmishra7676
    @reyanshmishra7676 ปีที่แล้ว +12

    The best explanation I have found for this problem.
    Alog is very simple now
    1. Identity the sorted half.
    2. Check if the target lies in the sorted half.
    Thats it you need to do this two things only.

  • @junaidahmed3615
    @junaidahmed3615 10 หลายเดือนก่อน +7

    what an absolutely great explanation. i watched another video before this and it was so convoluted for no reason. yours is so simple and easy to grasp

  • @junaiid0104
    @junaiid0104 หลายเดือนก่อน +1

    crazy concept striver ! I'm just loving your binary search playlist!!!

  • @beingproductive22
    @beingproductive22 6 หลายเดือนก่อน +3

    here after love babar lec - 14 for rotated sorted array he is using the concept of pivot element which is little messy
    but striver what a lovely lovely explanation
    in 1 go i understood and coded it myself

    • @Josuke217
      @Josuke217 หลายเดือนก่อน

      I learned recursion stack and queues from him , he's not a good teacher .

  • @venkatsaireddy1412
    @venkatsaireddy1412 6 หลายเดือนก่อน +1

    Thank You Raj Vikramaditya.
    I am a scaler student , i fond of Your teaching skills more than scaler instructors.

  • @ML-ok9nf
    @ML-ok9nf 9 หลายเดือนก่อน +2

    One of the best explanations for this problem on the internet!

  • @unknown2003august
    @unknown2003august 2 หลายเดือนก่อน +1

    Notes for me☺
    As we get our mid at any index checks arr[num]==target if it satisfies return here.
    After that
    Case 1>
    Array is left sorted(we check it by standing on mid),
    ==>Checks where our target lies in sorted(between low to mid ) or outside it by using
    if(arr[low]=target)
    if it lies inside this it indicates we need to collapse window by taking high to mid -1 otherwise low to mid+1
    Case 2>
    Array is right sorted similarly we check for it and updates our low and high accordingly
    if we never get it we return -1 to it

  • @pratikkumarsingh8114
    @pratikkumarsingh8114 9 หลายเดือนก่อน +2

    Understood bhaiya , thw way of teching is another level, I don't have words to express my feelings. Thanks a lot, bhaiya!!!

  • @mdsalimtauheedm-5810
    @mdsalimtauheedm-5810 5 หลายเดือนก่อน +1

    honestly I was very confused and demotivated after watching Rohit negi sir's explanation in paid course , i spent 2 hour to understand this problem but could not get it , after watching strivers explanation i get it only after single iteration. thanks a lot . now i am going to follow strivers AtoZ DSA

  • @venkatesasrikanthdhulipala9486
    @venkatesasrikanthdhulipala9486 10 หลายเดือนก่อน +3

    one small correction in the code it will fail if the array is [3,1] and target = 1
    because of code in line no 9 i.e k

  • @abhimanyuambastha2595
    @abhimanyuambastha2595 5 หลายเดือนก่อน +1

    Looked at neetcode video, then yours. His explanation was a bit confusing and had to do some examples to understand it. Yours almost made it a regular easy binary search

  • @adarshmv261
    @adarshmv261 3 หลายเดือนก่อน

    Understood. The best explanation on youtube for this problem..

  • @sreevarshinirg4319
    @sreevarshinirg4319 หลายเดือนก่อน

    Understood, Tq for this great help by teaching in youtube for free

  • @sujalgupta6100
    @sujalgupta6100 3 หลายเดือนก่อน

    Finally understood this problem. Every time I saw rotated sorted array or binary search in general I always skipped.

  • @hrishii.02
    @hrishii.02 2 หลายเดือนก่อน

    Understood! What a simple and affective explaination

  • @VasanthChoudary-uc5cz
    @VasanthChoudary-uc5cz 9 หลายเดือนก่อน +1

    Thankyou for providing this course for free bro.

  • @mriit3025
    @mriit3025 3 หลายเดือนก่อน

    best possible understanding through the BS playlist!

  • @prernagupta7450
    @prernagupta7450 5 หลายเดือนก่อน

    YOU Can understand very well and i see a many video but my concept is not clear but just i see that video which would be clearly the concept very easily

  • @kaushiksen2190
    @kaushiksen2190 10 หลายเดือนก่อน +1

    Amazing video, very good explanations, took sometime to understand but went through it again and again to understand it completely. Thanks for making such quality content Striver Bhai

  • @user-pr8ir3ow3v
    @user-pr8ir3ow3v ปีที่แล้ว +2

    Great Raj bhai... you deserve to be in elite class.
    keep rocking

  • @swathigp3818
    @swathigp3818 4 หลายเดือนก่อน

    This great quality content for free !!! Amazing work , please keep making these great videos 👏👏👏👏

  • @prathamrawat6298
    @prathamrawat6298 หลายเดือนก่อน

    bhaiya bhot bhot bhot hi aacha genuinely , bhot pyara samjhaya, too good!

  • @cinime
    @cinime ปีที่แล้ว +2

    Understood! Super fantastic explanation as always, thank you so so much for your effort!!

  • @UserUser-tn8tv
    @UserUser-tn8tv 7 หลายเดือนก่อน

    Understood Please keep consistent and eventually complete the series of A to Z DSA Course....
    Thank You

  • @ishangujarathi10
    @ishangujarathi10 ปีที่แล้ว +1

    mann unbelievable intuition and explanation!! loved it !!! understood completely

  • @Raj-jw7kq
    @Raj-jw7kq 29 วันที่ผ่านมา

    quality GOD LEVEL 🔥 🔥

  • @MonuKumar-n8q
    @MonuKumar-n8q 5 วันที่ผ่านมา

    Great explanation

  • @sandeeprajsaimon8600
    @sandeeprajsaimon8600 หลายเดือนก่อน

    best explanation ever

  • @AshishSharma-kg1yy
    @AshishSharma-kg1yy หลายเดือนก่อน

    woww what a great explanation

  • @kumpatisupriya3947
    @kumpatisupriya3947 8 หลายเดือนก่อน

    What an explanation bro..
    You are our lives savior 🙏🙏

  • @Abhishekkumarnjw22-vf7cr
    @Abhishekkumarnjw22-vf7cr 22 วันที่ผ่านมา

    Great help you are doing

  • @HarshSingh-hk8fe
    @HarshSingh-hk8fe 7 หลายเดือนก่อน

    bro the way you explain is just amazing thanks a lot

  • @vinitverma1741
    @vinitverma1741 10 หลายเดือนก่อน +1

    Thank u for such a great explaination

  • @user-iv1ik6nq3y
    @user-iv1ik6nq3y 2 หลายเดือนก่อน

    Great explanation.

  • @yashraorane578
    @yashraorane578 หลายเดือนก่อน

    Best explanation💯

  • @radha7492
    @radha7492 10 หลายเดือนก่อน +1

    thank you so much sir...respect for your amazing efforts...really no one teaches better than you... raj cum striver..i wish for your long life and happiness..

  • @nagame859
    @nagame859 ปีที่แล้ว

    Understood as always! The intuition/approach is just awesome🤩. Spellbound!

  • @Sparky579
    @Sparky579 4 หลายเดือนก่อน +1

    watching this on 0.75x playback speed feels like I'm watching a drunk person explaining me how to solve this problem.

  • @bujagawnisaitejagoud2461
    @bujagawnisaitejagoud2461 2 หลายเดือนก่อน

    Very good explanation

  • @hareshnayak7302
    @hareshnayak7302 4 หลายเดือนก่อน

    Understood,Thanks stiver for this amazing video.

  • @Agustus1231
    @Agustus1231 3 หลายเดือนก่อน

    Very well Understood sir

  • @srutisingh4629
    @srutisingh4629 8 หลายเดือนก่อน +1

    Hats off to you❤

  • @revanthkumar5417
    @revanthkumar5417 ปีที่แล้ว

    Best explanation so far in binary search

  • @user-hh9uk7sk3w
    @user-hh9uk7sk3w 16 วันที่ผ่านมา

    understood nicely

  • @Dibyadipan
    @Dibyadipan วันที่ผ่านมา

    Understood! watching your lectures and taking dsa notes, during college classes 😂❤ (17/8/24)

  • @PeterParker-ee6ep
    @PeterParker-ee6ep 10 หลายเดือนก่อน

    everyone just try dry run after you complete video after your understanding, it really in understanding still better. try ittt

  • @k.satish3663
    @k.satish3663 ปีที่แล้ว

    Totally understood.your teaching is superb.thank you

  • @user-cz4fw7ls8m
    @user-cz4fw7ls8m 2 หลายเดือนก่อน

    Nice Explanation😄

  • @learning_trespasser
    @learning_trespasser 7 หลายเดือนก่อน

    acche se samzaya, thanks

  • @rtheame4704
    @rtheame4704 3 หลายเดือนก่อน

    Very well explained 👏🏻👏🏻

  • @user-ti3bd8mp1w
    @user-ti3bd8mp1w ปีที่แล้ว

    understood
    Thank you striver for making things easy...

  • @Musicuvakavi1823
    @Musicuvakavi1823 4 หลายเดือนก่อน

    Understood well thanks for this valuable video sir

  • @umangkumar2005
    @umangkumar2005 6 หลายเดือนก่อน

    This is the best explanation

  • @anddevsahil
    @anddevsahil 4 หลายเดือนก่อน

    Can't find better explanation than striver .

  • @mirzasohailhussain
    @mirzasohailhussain 8 วันที่ผ่านมา

    Your explanation was much better than neetcodeio, thanks for explaining in such a detail. I was really missing the point to identify sorted part.
    Can you please tell me what app you are using for pencil work.

  • @qihse1531
    @qihse1531 9 หลายเดือนก่อน +2

    Any thoughts on this corner case not passing: ARR=[3,1], target:1, Why is that? How to generalize the solution?

    • @qihse1531
      @qihse1531 9 หลายเดือนก่อน

      Other than that, beautiful explanation charm💯💯

  • @user-rf7ri9pw9p
    @user-rf7ri9pw9p ปีที่แล้ว +9

    Can anyone share the video link for peak element ?

  • @HarshSingh-nq4oe
    @HarshSingh-nq4oe หลายเดือนก่อน

    Understood
    Thank you.

  • @ADITYASRIVASTAVABCE
    @ADITYASRIVASTAVABCE ปีที่แล้ว

    Thankyou for clear explanation. Loved it.

  • @aaranyaksantra9933
    @aaranyaksantra9933 หลายเดือนก่อน

    nice explanation

  • @rahuljain224
    @rahuljain224 2 หลายเดือนก่อน

    Excellent explanation

  • @selene8721
    @selene8721 8 วันที่ผ่านมา

    Thank you so much!

  • @ujjawalchourasiya3988
    @ujjawalchourasiya3988 5 หลายเดือนก่อน

    Love you bhaiya . You are my inspiration ❤

  • @BalajiG-ms3vu
    @BalajiG-ms3vu 3 หลายเดือนก่อน

    Understood bro,thank you so much.

  • @sanchisingh5117
    @sanchisingh5117 ปีที่แล้ว

    striver's explanations are the best

  • @parthjain8080
    @parthjain8080 หลายเดือนก่อน +1

    Understood

  • @kingbadshah452
    @kingbadshah452 6 หลายเดือนก่อน

    thanks striver understood everything

  • @RaviKumar-sn6tu
    @RaviKumar-sn6tu 4 หลายเดือนก่อน

    understood captain ..
    😇

  • @RajNamdev_19
    @RajNamdev_19 หลายเดือนก่อน +1

    Understood :)

  • @myproject6768
    @myproject6768 ปีที่แล้ว +1

    Absolutely understand ❤

  • @neerajpruthi8350
    @neerajpruthi8350 5 หลายเดือนก่อน

    Love the explanation. THanks

  • @anishasaini380
    @anishasaini380 5 หลายเดือนก่อน

    sir Best explanation Thanks!!

  • @harshilpatel3205
    @harshilpatel3205 6 หลายเดือนก่อน

    Amazing explanation sir 😇!

  • @secretvibz6300
    @secretvibz6300 หลายเดือนก่อน

    Got clearity that what is the main aim of binary search

  • @rajkumarvb5197
    @rajkumarvb5197 9 หลายเดือนก่อน

    Understood, thanks for your efforts!

  • @rashmirsd
    @rashmirsd ปีที่แล้ว

    Very nice explanation. Thank you

  • @mathialagant
    @mathialagant 6 หลายเดือนก่อน

    9:56
    Perfect reaction 😂

  • @thanziaa3215
    @thanziaa3215 หลายเดือนก่อน

    superb videos

  • @tree7500
    @tree7500 ปีที่แล้ว

    yes understood will try it out

  • @mohitsingh13
    @mohitsingh13 17 วันที่ผ่านมา

    Understood ❤

  • @user-fh9kt2zp7p
    @user-fh9kt2zp7p 10 หลายเดือนก่อน

    Understood striver bhaiya

  • @AbhijeetMuneshwar
    @AbhijeetMuneshwar 3 หลายเดือนก่อน

    Understood very well !!!

  • @SupreetSinghsuppi
    @SupreetSinghsuppi 2 หลายเดือนก่อน

    Great video as always. Can there be a point in the sub array where both the halves are sorted.

  • @manavsingh5919
    @manavsingh5919 11 หลายเดือนก่อน

    Thank You Striver....Understood it

  • @akaashk623
    @akaashk623 11 หลายเดือนก่อน

    Greatly explained 👏👏

  • @tanishkthakur9965
    @tanishkthakur9965 3 หลายเดือนก่อน +1

    understood

  • @b52chetanlandge96
    @b52chetanlandge96 หลายเดือนก่อน

    Understood 👍👍

  • @rakshitraushan1650
    @rakshitraushan1650 5 หลายเดือนก่อน

    Understood bro!! Ur a gem!

  • @sumitpisal7069
    @sumitpisal7069 6 หลายเดือนก่อน +1

    This approach is not working when at start mid is at such position where both left and right are sorted the search goes in wrong direction , not submitted on leetcode please help @striver

  • @sravansatapathi813
    @sravansatapathi813 หลายเดือนก่อน

    Understood❤‍🔥

  • @jayantmishra2266
    @jayantmishra2266 ปีที่แล้ว +2

    1 QUESTION : will this approach/code work in the case of left rotated array also?? bacause here you explained for right rotated example.

    • @abhaymandal4903
      @abhaymandal4903 11 หลายเดือนก่อน

      Yes , same code will be there for left rotared.

  • @apmotivationakashparmar722
    @apmotivationakashparmar722 6 หลายเดือนก่อน

    Great Explaination