ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
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
Please comment understood and give us a like if you got everything :)
Understood sir! This really cleared my doubt regarding the process the code performed in else part! Thank you sir!!
Very well Understood sir 😀
Understood
Now I clearly know how you got a job at Google.😁
Understood
We never move backward bcoz we have Take You Forward😇
That's a good one 😁
little cringe brother.
@@surendharv795 ok so called mature sigma boy
09:56 seriously i watched this many times to see your expression 😄
Yeah and The little smile when he continued... so cute ❤
that,s nice on which lecture you are currently
@@yoongicorn7973
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!!
God tier explanation. I truly can't put in words how easily and clearly you were able to explain a seemingly confusing question!
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...
I think people should pay for this next level quality content.
@@iamnoob7593 haa...if u wish to.. then plss donate that money to some nearby ngos.
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
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
09:56 reaction lol
Correct
nalla bc
@@epsaepsit4645hahahahaha
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.
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
crazy concept striver ! I'm just loving your binary search playlist!!!
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
I learned recursion stack and queues from him , he's not a good teacher .
Thank You Raj Vikramaditya.
I am a scaler student , i fond of Your teaching skills more than scaler instructors.
One of the best explanations for this problem on the internet!
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
Understood bhaiya , thw way of teching is another level, I don't have words to express my feelings. Thanks a lot, bhaiya!!!
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
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
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
Understood. The best explanation on youtube for this problem..
Understood, Tq for this great help by teaching in youtube for free
Finally understood this problem. Every time I saw rotated sorted array or binary search in general I always skipped.
Understood! What a simple and affective explaination
Thankyou for providing this course for free bro.
best possible understanding through the BS playlist!
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
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
Great Raj bhai... you deserve to be in elite class.
keep rocking
This great quality content for free !!! Amazing work , please keep making these great videos 👏👏👏👏
bhaiya bhot bhot bhot hi aacha genuinely , bhot pyara samjhaya, too good!
Understood! Super fantastic explanation as always, thank you so so much for your effort!!
Understood Please keep consistent and eventually complete the series of A to Z DSA Course....
Thank You
mann unbelievable intuition and explanation!! loved it !!! understood completely
quality GOD LEVEL 🔥 🔥
Great explanation
best explanation ever
woww what a great explanation
What an explanation bro..
You are our lives savior 🙏🙏
Great help you are doing
bro the way you explain is just amazing thanks a lot
Thank u for such a great explaination
Great explanation.
Best explanation💯
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..
Understood as always! The intuition/approach is just awesome🤩. Spellbound!
watching this on 0.75x playback speed feels like I'm watching a drunk person explaining me how to solve this problem.
Very good explanation
Understood,Thanks stiver for this amazing video.
Very well Understood sir
Hats off to you❤
Best explanation so far in binary search
understood nicely
Understood! watching your lectures and taking dsa notes, during college classes 😂❤ (17/8/24)
everyone just try dry run after you complete video after your understanding, it really in understanding still better. try ittt
Totally understood.your teaching is superb.thank you
Nice Explanation😄
acche se samzaya, thanks
Very well explained 👏🏻👏🏻
understood
Thank you striver for making things easy...
Understood well thanks for this valuable video sir
This is the best explanation
Can't find better explanation than striver .
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.
Any thoughts on this corner case not passing: ARR=[3,1], target:1, Why is that? How to generalize the solution?
Other than that, beautiful explanation charm💯💯
Can anyone share the video link for peak element ?
Understood
Thank you.
Thankyou for clear explanation. Loved it.
nice explanation
Excellent explanation
Thank you so much!
Love you bhaiya . You are my inspiration ❤
Understood bro,thank you so much.
striver's explanations are the best
Understood
thanks striver understood everything
understood captain ..
😇
Understood :)
Absolutely understand ❤
Love the explanation. THanks
sir Best explanation Thanks!!
Amazing explanation sir 😇!
Got clearity that what is the main aim of binary search
Understood, thanks for your efforts!
Very nice explanation. Thank you
9:56
Perfect reaction 😂
superb videos
yes understood will try it out
Understood ❤
Understood striver bhaiya
Understood very well !!!
Great video as always. Can there be a point in the sub array where both the halves are sorted.
Thank You Striver....Understood it
Greatly explained 👏👏
understood
Understood 👍👍
Understood bro!! Ur a gem!
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
Understood❤🔥
1 QUESTION : will this approach/code work in the case of left rotated array also?? bacause here you explained for right rotated example.
Yes , same code will be there for left rotared.
Great Explaination