Lecture 13: Binary Search Interview Questions [Google, Amazon, Microsoft] || ProblemSet - 1

  Рет қаралды 866,182

CodeHelp - by Babbar

CodeHelp - by Babbar

Күн бұрын

Пікірлер: 1 200
@omeshnath6826
@omeshnath6826 3 жыл бұрын
Bhaiya app toh pichla lecture khtm karne se pehle hi dusra lecture daal dete ho thumbs up
@jaikhatri4783
@jaikhatri4783 3 жыл бұрын
Sahi mein bhai
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/h4XEmnlug5ucabs
@learnwithdivya7963
@learnwithdivya7963 2 жыл бұрын
​@@jaikhatri4783 d k d m
@learnwithdivya7963
@learnwithdivya7963 2 жыл бұрын
​@@jaikhatri4783 hot
@learnwithdivya7963
@learnwithdivya7963 2 жыл бұрын
​@@jaikhatri4783 hot hai
@harshmedhavi2509
@harshmedhavi2509 3 жыл бұрын
Now that's what we call as Quality content! Bhaiya please continue like this, we all are blessed to have you as our mentor! Thanks.
@jyotiswain2262
@jyotiswain2262 2 жыл бұрын
😍 Trueeee! Blessed to have this series in this crucial placement period.
@RobertSmith-by5fp
@RobertSmith-by5fp 2 жыл бұрын
s=mid+1 , to bhi us par ja skta hai??
@sandeepsalaria2243
@sandeepsalaria2243 2 жыл бұрын
@@RobertSmith-by5fp bhai if condition mai arr[mid]
@RobertSmith-by5fp
@RobertSmith-by5fp 2 жыл бұрын
@@sandeepsalaria2243 man lo ki , mid hai wo peak ke just pehle wala element hai tb to arr[mid]
@sandeepsalaria2243
@sandeepsalaria2243 2 жыл бұрын
@@RobertSmith-by5fp Dry run kro khud feel aa jayega bhai. Visualise kro mid+1 agreed hoga bhi toh wo mid ke brbar hi hoga nd tb wo dusri condition ko check kr lega na else wali jispe mid ke brbar hai thn peek element mil jayega
@karanchilana228
@karanchilana228 Жыл бұрын
You are absolutely leaving a legacy behind every lecture.. student's respect towards you is increasing constantly by the magnitude of your hard work.. thanks a lot man
@sahilanand30
@sahilanand30 3 жыл бұрын
The best and the unique thing about this coursr is, it's not helpful for beginners only. Instead it's helpful for all skill levels of programmers. Best content 🔥
@musharrafm1154
@musharrafm1154 2 жыл бұрын
This is by far the best DSA course ever on the planet!!!!!!!!!!!!! Thank you so much bhaiyya! I'm able to understand DSA like a robot now, after struggling for 1 year searching random videos on KZbin.
@mastermaxin1548
@mastermaxin1548 Жыл бұрын
bro isme error bata de pls first occurrence hi nhi chal hi #include using namespace std; int firstocc(int arr[],int size,int key){ int start = 0; int end= size-1; int ans = -1; int mid = start +( end -start )/2; while(start
@photon7404
@photon7404 16 күн бұрын
@@mastermaxin1548 sahi toh hai .
@techprogrammer4158
@techprogrammer4158 3 жыл бұрын
Literally Cried babbar bhai because I am not able to find the best course for DSA. But you are making the videos which I wanted and 1 hour videos are not at all making me bored because I love your way of teaching and style. Please dont stop the series any way. Because it makes my heart to be broken 💔. Love from Hyderabad.
@MilanParmar.
@MilanParmar. 2 жыл бұрын
hello bhai abhi kya kar rahe ho?
@a.revanthkumar1827
@a.revanthkumar1827 2 жыл бұрын
Hi bro What are you Doing and where do you stay in Hyderabad , Can I get u r contact
@mrshephu
@mrshephu Жыл бұрын
@@a.revanthkumar1827 hi me
@therahul5304
@therahul5304 Жыл бұрын
U
@kabir2190
@kabir2190 Жыл бұрын
you cried because you are serious for your life hats off bruh
@abdullahshaikh7409
@abdullahshaikh7409 2 жыл бұрын
For question 2: int peakIndexInMountainArray(vector& arr) { int start = 0; int end = arr.size()-1; int mid = start + (end - start)/2; while(start arr[mid+1]) { return mid; } else if(arr[mid] < arr[mid+1]) { start = mid + 1; } else { end = mid; } mid = start + (end - start)/2; } return -1; } faster than 93.30% ye approach intutive aur efficent hai
@adarsh1360
@adarsh1360 2 жыл бұрын
wahi approach to he whule me equality nhi chaie ek comparison extra ho raha
@mkat21
@mkat21 Жыл бұрын
this is easier to understand I was confused by sirs approach this clarifies it .thank you.
@cuteminired6550
@cuteminired6550 5 ай бұрын
Thanks man
@yashzawar7938
@yashzawar7938 3 жыл бұрын
please try to cover more questions so that we will get enough confidence to solve by ourselves. Great content and great efforts, this DSA series is truly amazing and you are a gem!
@mastermaxin1548
@mastermaxin1548 Жыл бұрын
bro please isme error bata de first occurence hi nhi chal raha #include using namespace std; int firstocc(int arr[],int size,int key){ int start = 0; int end= size-1; int ans = -1; int mid = start +( end -start )/2; while(start
@63_leticiajacob14
@63_leticiajacob14 Жыл бұрын
@@mastermaxin1548 Run ho raha h, bas array mai repeating elements add karo
@aryyann05
@aryyann05 4 ай бұрын
@@mastermaxin1548 chal toh rha hai bhai
@vikasjat3613
@vikasjat3613 2 жыл бұрын
Thank you so much bhaiya for giving us this series. Almost all the students in our college use this series to prepare DSA.🙂
@ayushgupta-gt4ch
@ayushgupta-gt4ch 2 жыл бұрын
the most admirable aspect is that you are not in a hurry ,you try to explain each topic through many times and in many ways,,,thats really a commendable job. rest everything is completely fantastic
@nitinsharma7251
@nitinsharma7251 3 жыл бұрын
This is best dsa course I've ever encountered in youtube Thanks for such great content free of charge
@dharrsanamarnath7541
@dharrsanamarnath7541 3 жыл бұрын
Istg Apna College had efforts into making it beautiful. Babbar makes sures we understand, he doesnt skip with half written code
@yathinkumar5356
@yathinkumar5356 2 жыл бұрын
@@dharrsanamarnath7541 Very true, I used to follow apna college before, but it feels like half completed on the explanation side
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/h4XEmnlug5ucabs
@sjcreations2490
@sjcreations2490 3 жыл бұрын
Bhaiya may the Almighty bless you for providing such a quality content for free to all the students, 👍☺
@mastermaxin1548
@mastermaxin1548 Жыл бұрын
bro please isme error bata de first occurence hi nhi chal raha #include using namespace std; int firstocc(int arr[],int size,int key){ int start = 0; int end= size-1; int ans = -1; int mid = start +( end -start )/2; while(start
@sidhantchaudhary9202
@sidhantchaudhary9202 Жыл бұрын
@@mastermaxin1548 koi error nhi h thik chl rha h ekdm
@govindsuryavanshi6653
@govindsuryavanshi6653 Жыл бұрын
First I have completed all DSA series and now conclude this is Greatest ever DSA series to exist on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇‍♂
@nipunbansal6057
@nipunbansal6057 3 жыл бұрын
I am in first year and this course make me skillful than my seniors(mostly) in coding . Thank you for this
@Nishad_Ranade1729
@Nishad_Ranade1729 3 жыл бұрын
Bhaiiya one suggestion ....I want two things from you. 1) First one is If possible you give topic time table that which topic you will teach us in which day or date so we can atleast prepare the topic understand the topic by ourselves and solve some problem related to topic ..... which helps us to understand all points that you taught in video 2) And second one is you give all difficulty level question links ( generally medium and hard) and maximum problems of that topic to us that we can master the topic and solve any problem of that topic in all formats in interview or in CP, or in leetcode and all other platforms....
@prernapriya8699
@prernapriya8699 3 жыл бұрын
yes right
@daayush6654
@daayush6654 3 жыл бұрын
Eagerly waiting for part 2 and 3 of binary search questions :)
@priyanshumundra4453
@priyanshumundra4453 3 жыл бұрын
find pivot index:- class Solution { public: int pivotIndex(vector& num) { int sum = 0; for(int i=0; i
@encoderdude
@encoderdude 2 жыл бұрын
thanks dude
@prathamgupta3984
@prathamgupta3984 Жыл бұрын
thanks vaii...
@AnotherGmail-z7n
@AnotherGmail-z7n Жыл бұрын
The code for finding peak element index is not absolutely correct you can try this one int mountainPeak(int arr[], int n){ int start = 0; int end = n - 1; int mid = start + (end - start)/2; while (start arr[mid]) { end = mid - 1; } else{ start = mid + 1; } mid = start + (end - start)/2; } }
@mayanvajani934
@mayanvajani934 6 ай бұрын
in the 1st if condition add a condition that also mid!=0,otherwise when mid=0,it would overflow.
@Shagunkaushik2929
@Shagunkaushik2929 6 ай бұрын
​@@mayanvajani934explain it in detail why it will overflow I m unable to get ur point
@communist_amoeba3923
@communist_amoeba3923 14 күн бұрын
also use else if instead of if and else. or complier won't give answer
@dheerajmehra320
@dheerajmehra320 2 жыл бұрын
what did i learn in this lecture 1. how to manipulate the standard binary search code when required if the array is sorted 2 . how to find first and last occurance of the element 3. how to find the total no of occurance of the element in the sorted array 4. how to find the peak index of the mountain array
@rahulrastogi5312
@rahulrastogi5312 3 жыл бұрын
Bhaiya instead of doing e=mid in mountain array question we could have also added a new condition for the peak itself where (arr[mid]>arr[mid-1] && arr[mid]>arr(mid+1]) ... it's just for more clarity if by chance somebody is not getting it ... Thanks Bhaiya ❤️
@RohitKumar-zd2hu
@RohitKumar-zd2hu 2 жыл бұрын
Very good point
@ayushiiitian
@ayushiiitian 2 жыл бұрын
Yeah I have also done by this method apart from what sir told😀
@simranbandhu9926
@simranbandhu9926 2 жыл бұрын
agar arr[mid]
@samudralaabhiramrao5904
@samudralaabhiramrao5904 2 жыл бұрын
​@@simranbandhu9926 then we are saying end = mid
@RahulKumar-tq2xb
@RahulKumar-tq2xb 2 жыл бұрын
if mid=0 then arr[mid]>arr[mid-1] will give a runtime error. will need to bypass that.
@princekumarand6284
@princekumarand6284 6 ай бұрын
bhaiya last moment pr humesha realize hota hai ki padhna hai but jab teacher itna acha hona toh last moment me pressure ki jagah confidence ajata....am boosted and after wasting 2 year college am full power completing your series from last month❤❤❤
@study_desk4231
@study_desk4231 2 жыл бұрын
Q1) FIRST and LAST occurrence EASIEST and FAST solution: #include pair firstAndLastPosition(vector& arr, int n, int key) { // LOWER BOUND first index dega key ki ya fir index of a value < key if key is not present. //UPPER BOUND last occurance of key k index se ek index bada k dega and if key is not present tab woh end value i.e. arr.size() de dega pair p; int first = lower_bound(arr.begin(),arr.end(),key) - arr.begin(); if(arr[first]!=key) //checking key present or not { p.first=-1; p.second=-1; return p; } //ab value to pakka present hai.. toh upper bound jo bhi index de usse ek kam karne se jo index aaega last occurance wahi hogi. int last = upper_bound(arr.begin(),arr.end(),key) - arr.begin() -1; p.first= first; p.second= last; return p; }
@mastermaxin1548
@mastermaxin1548 Жыл бұрын
bro first t occurrence me error bata de #include using namespace std; int firstocc(int arr[],int size,int key){ int start = 0; int end= size-1; int ans = -1; int mid = start +( end -start )/2; while(start
@parthlahoti5404
@parthlahoti5404 Жыл бұрын
another approach for peak mountain array. class Solution { public: int peakIndexInMountainArray(vector& arr) { int start=0;int end=arr.size()-1; int mid=start+(end-start)/2; while(startarr[mid+1]){ end=mid-1; } if(arr[mid]arr[mid+1]&&arr[mid]>arr[mid-1]){ return mid; } mid=start+(end-start)/2; } return mid; } };
@097mazharsaifi8
@097mazharsaifi8 Жыл бұрын
i can feel and see my improvement in the dsa after learning from your lectures ...thankyou so much Babbar bhai...❣❣
@suyashverma156
@suyashverma156 2 жыл бұрын
jitna dedication se mae ye series complete kr rha hun uthna mae apni fav web series bhi nhi kiya hun...apka samjane ka tarika bhaut addictive hae bhaiya
@HighPingMonk
@HighPingMonk 2 жыл бұрын
Mad respect for this guy....!! ❤️
@shrutivvv
@shrutivvv 15 күн бұрын
Seen plenty of videos for this question, but this is the best!
@RohitRana-tz2lr
@RohitRana-tz2lr 2 жыл бұрын
Thanks, bhaiya for this video... now I am getting confidence in DSA... just because of you... Grateful to have teacher like you.
@rajvishwakarma5672
@rajvishwakarma5672 2 жыл бұрын
Pivot in an array: int pivotIndex(vector& nums) { int lsum = 0; int tsum = 0; for(int i=0; i
@anushkayachit
@anushkayachit 3 жыл бұрын
Thank you sir you are really the best teacher!!!!! Just one question.... when is this course estimated to complete?? I'm asking because i have my placements in 4-5 months.... i hope i get extra time to prepare after this course ends. Anyway.... love this video!!
@CodeHelp
@CodeHelp 3 жыл бұрын
I m working hard to cover everything swiftly. I m estimating to complete this course around March
@abhilashpaul4371
@abhilashpaul4371 3 жыл бұрын
Thank you for your effort sir!!!🙏🙏
@sandeep_khariwal8137
@sandeep_khariwal8137 3 жыл бұрын
@@CodeHelp Bhaiii market me 🔥🔥🔥🔥 aag lga dii ....apka content or explanation cout
@Mb-nr5nz
@Mb-nr5nz 3 жыл бұрын
@@CodeHelp do we need to learn c++ language before starting this course or we can just learn c++ basics side by side
@Mb-nr5nz
@Mb-nr5nz 3 жыл бұрын
@@CodeHelp and also by just doing your this dsa course can my placement dsa part get covered completely or I need to learn any other things of dsa
@pranavgaur1086
@pranavgaur1086 Жыл бұрын
for the peak element in mountain his approach of using end = mid is due to the nature of the problem where we if say the mid is correct then we dont want to skip so we store as end =mid . this will result in the remaining array to become monotonic where the condition of arr[i]
@ashutoshadya5286
@ashutoshadya5286 Жыл бұрын
For peak element index you can also do - int peakIndexInMountainArray(vector& arr) { int s=0; int e=arr.size()-1; int mid=s+(e-s)/2; while(s
@anamikaverma8866
@anamikaverma8866 Жыл бұрын
I submitted your code as well as sir's code but i am getting 1 case wrong. 49/50 are correct but one with 4000 elements is incorrect..please help
@anshultrehan743
@anshultrehan743 Жыл бұрын
Bhai tle maar gya Mera similar logic lose Kiya tha
@iamprateek3220
@iamprateek3220 10 ай бұрын
@@anamikaverma8866 try this: int peakIndexInMountainArray(vector& arr) { int n= arr.size(); int l=0; int r=n-1; int mid= l+((r-l)/2); while(larr[mid-1])){ return mid; } else{ r=mid-1; } mid= l+((r-l)/2); } return 0; }
@iamprateek3220
@iamprateek3220 10 ай бұрын
@@anshultrehan743 try this : int peakIndexInMountainArray(vector& arr) { int n= arr.size(); int l=0; int r=n-1; int mid= l+((r-l)/2); while(larr[mid-1])){ return mid; } else{ r=mid-1; } mid= l+((r-l)/2); } return 0; }
@AbhishekKumar-nz9dn
@AbhishekKumar-nz9dn 2 жыл бұрын
bhai video abhi start kari hai . socha likh deta hu. bhai aap kamaal ho bhai . ❤️🙏👍💕
@VihaaShetty
@VihaaShetty 2 жыл бұрын
No words, you are just the great teacher one can ask for, hats off!!🙏🙌
@scoc55vora15
@scoc55vora15 2 жыл бұрын
Peak index in Mountain Array wala QUESTION ekdum faadu tha ❤️ Truely You mean it what you said "Course poori Tarah se Placement oriented Hain"🔥
@AmandeepSingh-lc3kg
@AmandeepSingh-lc3kg 2 жыл бұрын
thank youh bhaiya ji loving this course.... awsome explanation .... every concept is explained with example more than enough...just the course i every coder ever wanted...just thanks once again
@princeprakash0957
@princeprakash0957 2 жыл бұрын
Cin>>time and patience to love babbar dsa course; Cout
@random-0
@random-0 2 жыл бұрын
H/W: //Pivot sum // time complexity: O(n), Space complexity: O(1) //after coming with this approach by myself I thought it's not efficient enough as I'm scanning the array twice but I was amazed after seeing that in leetcode discussion section this is the best solution given //lagta hai ye series ke karan aacha logic build ho reha hai. THANKYOU!!! class Solution { public: int pivotIndex(vector& nums) { int len = nums.size(); int totalSum = 0; for(int i =0; i
@mastermaxin1548
@mastermaxin1548 Жыл бұрын
bro isme error bata de #include using namespace std; int firstocc(int arr[],int size,int key){ int start = 0; int end= size-1; int ans = -1; int mid = start +( end -start )/2; while(start
@arnabsingh364
@arnabsingh364 Жыл бұрын
@@mastermaxin1548 put key == arr[mid], not arr[mid] == key and so on
@priyanshkumar17
@priyanshkumar17 Жыл бұрын
What's the question number for this problem on LeetCode ?
@iamprateek3220
@iamprateek3220 10 ай бұрын
@@arnabsingh364 == operator is commutative so that doesn't change anything
@stake_top
@stake_top Жыл бұрын
My approch for 2nd question int peak(int arr[],int n){ int i=1; int ans; while(arr[i]>arr[i-1]){ ans=i; i=i+1; } return ans;}
@riyarai670
@riyarai670 3 жыл бұрын
Completed this lecture bhaiya also done the homework....All thanks to you......Aapki videos without any doubt motivation boost kar deti hai jaise jaise har concept clear hota jata hai vaise vaise motivation boost hota jata hai......BIG THANKS BHAIYA
@devyanshubhardwaj9460
@devyanshubhardwaj9460 3 жыл бұрын
thanku bhaiya so much i am in second year right now and before this course was launched i was woried about my progress in dsa but after watching all yr vedios i am in great confidence that i can crack any company i have seen may playlist and follows may channels but this most premium playlist i have ever seen waiting for upcoming vedio bhaiya !!!!!!
@amulyaabhinandan8161
@amulyaabhinandan8161 3 жыл бұрын
*Another method for Peak Index in a Mountain Array:-* class Solution { public: int peakIndexInMountainArray(vector& arr) { //using my own algorithm int s=0, e=arr.size()-1; int i=0; while(s < e) { if(arr[i] < arr[i+1]) { i++; } else break;; } return i; } };
@Shivamkumar-xu6hu
@Shivamkumar-xu6hu 3 жыл бұрын
It's TC will be O(n)
@amulyaabhinandan8161
@amulyaabhinandan8161 3 жыл бұрын
@@Shivamkumar-xu6hu Yup, Complexity sucks😅
@bhavishyasharma998
@bhavishyasharma998 2 жыл бұрын
To my surprise Linear Seach Approach takes 183 ms which is nearly 2-10 ms lesser/more than binary search approach. pair p; int first_occ=-1; int last_occ=-1; for(int i=0;i
@abdxlive
@abdxlive 5 ай бұрын
Lecture 13 Completed On 10 June 2024
@adityaukey5234
@adityaukey5234 4 ай бұрын
Kitna hua bro abhi
@ahmadrasheed2598
@ahmadrasheed2598 2 ай бұрын
Best of luck
@yashchampaneri1972
@yashchampaneri1972 3 жыл бұрын
Are bhai full high josh me iss video ko dekhege! Mast!
@sjcreations2490
@sjcreations2490 3 жыл бұрын
It's my humble request please maintain this consistency till end. We all are with you bhaiya. Sab ek sath placed honge👍☺
@parthmangalkar
@parthmangalkar 2 жыл бұрын
Bhaiyya aap ko itne mehnat karte hue dekh kar hum inspire ho gaye hain!! Bas ab DSA mein bahut maja aa raha hain, kyun ki aap jo concepts sikhate hain na woh ekdum acche se samj aati hain aur problems bhi aap mast (acchi level) ke solve karvate ho!!
@h_a_r_s_h01
@h_a_r_s_h01 3 жыл бұрын
Bhaiya sometimes it happens, if I can't able to understood the concept, I feel like why I can't able to catch it, might be others are capable of, (e.g. XOR concept - Find Duplicates : 10th lecture) and this leads to massive demotivation. I knew your way of teaching is excellent but sometimes you goes extremely fast and furious. If someone is reading this comment kindly provide me solution for this issue. Regards ❤️
@parassetia4964
@parassetia4964 3 жыл бұрын
try watching that lecture again, and read more about that topic on google...explore a bit yourself That way it will be more clear to you and you might never forget that concept atleast coz you tried yourself for it
@CodeHelp
@CodeHelp 3 жыл бұрын
Will try to be a bit slow from next video
@dharrsanamarnath7541
@dharrsanamarnath7541 3 жыл бұрын
@@CodeHelp you are going by the correct speed. Else the lectures will be boring. I’m fresher Babbar bro. Love from India, Tamilnadu
@sunilshekhawat5080
@sunilshekhawat5080 3 жыл бұрын
Me also .
@sergion_brayen
@sergion_brayen Жыл бұрын
your teaching style is great bhaiya. you explain everything in easiest way love from bihar
@prashantmaurya6868
@prashantmaurya6868 3 жыл бұрын
35:10 Ques 3 - #include using namespace std; int peakElement(int arr[], int size) { int start = 0; int end = size - 1; int mid = start + (end - start) / 2; while (start arr[mid + 1]) { end = mid - 1; } if (arr[mid] > arr[mid + 1] && arr[mid] > arr[mid - 1]) { return arr[mid]; } mid = start + (end - start) / 2; } } int main() { int arr[9] = {1, 2, 3, 4, 6, 4}; cout
@harikumar3917
@harikumar3917 3 жыл бұрын
hanji
@shubhamvairagade1
@shubhamvairagade1 2 жыл бұрын
Hn
@vinay_rajput_1812
@vinay_rajput_1812 2 жыл бұрын
i think this will not work try corner cases,suppose peak element is present on 1 index then third condition will compare mid with negative index
@hemantpathak983
@hemantpathak983 10 ай бұрын
Love from 1st Yearite from IIT Dhanbad. Bhaiya you too famous among fist years here. Thanks and I pledge I will not leave in between.
@hermionegranger6493
@hermionegranger6493 2 жыл бұрын
binge watching this DSA series .....your teaching style is great!!
@shujahtali7968
@shujahtali7968 Жыл бұрын
Yr yeh code kidr run krty ho dev py error Dera ha 🙄
@sounaksaha1455
@sounaksaha1455 3 жыл бұрын
Best course on DSA.... I repeat... best course.... Hats off!
@virajdeshpande9821
@virajdeshpande9821 2 жыл бұрын
Time-Stamp 25:00 code: #include #include using namespace std; int firstOccurance(int arr[], int n, int key){ int s = 0; int e = n-1; int mid = (s+e)/2; int ans = -1; while(skey){ e = mid-1; } else if(arr[mid]
@rounakmukherjee9540
@rounakmukherjee9540 3 жыл бұрын
Awesome bhaiya as expected, Please don't feel demotivated when don't get reach.
@madhavgupta5493
@madhavgupta5493 2 жыл бұрын
Q2 (23:38) . Find total number of occurrence of a number in sorted array. #include using namespace std; int lastOccurence(int arr[], int size, int value) { int start = 0, end = size - 1, mid = start + (end - start) / 2, ans = -1; while (start
@MohdSameer-so9bt
@MohdSameer-so9bt 2 жыл бұрын
bhaiya maza aa gaya. Aisa shayad he kisi ne samjhaya hoga. keep up the good work bhaiya. Aap jaise teachers ho toh phir koi bhi ds algo nikal sakta hai.
@harry-cf4ii
@harry-cf4ii 3 жыл бұрын
Bhaiya if we do ur C++/DSA course does it even cover all the topics of theory for Competitive programming???or we have to do CP theory from other courses available out there!!!if yes then after doing ur course videos can we directly jump on codechef/codeforced paralelly and give contests???my dream is to become 6star on codechef or candidate master at codeforces. Is ur course also enough for CP?
@CodeHelp
@CodeHelp 3 жыл бұрын
First we will cover all the important topic for interviews, after that we will discuss CP topics.
@harry-cf4ii
@harry-cf4ii 3 жыл бұрын
@@CodeHelp so as am in 1st sem should i follow this course??as it it more interviews oriented and i want to do CP!!!
@shubhambansal1495
@shubhambansal1495 3 жыл бұрын
@@harry-cf4ii If you complete this course first and start your cp then you will feel motivated bcoz you will be able to solve questions more easily
@shubhamvairagade1
@shubhamvairagade1 2 жыл бұрын
@@harry-cf4ii hn bhai kr🙂 basics se hai
@Atvkaur1111
@Atvkaur1111 2 жыл бұрын
@@shubhambansal1495Bhaiya where I should take CP classes? Please tell some best classes?
@aayushgiri9788
@aayushgiri9788 2 жыл бұрын
bhaiya ye ek common sense vali approach mili.thoda tym extra lagega but easy code hai for first and last occurence question::: pair firstAndLastPosition(vector& arr, int n, int k) { pair p; for(int i=0;i=0;i--){ if(arr[i]==k){ p.second=i; break; } p.second=-1; } return p; }
@motivation_with_harsh
@motivation_with_harsh Жыл бұрын
//finding the occurance of a particular element in an array using binary search //A = {0,0,0,1,1,1,1,1,1,1,2,2,2,2,2} //find occurance of 1; //output -> occurance of 3 = 7 //code written by harsh shukla #include using namespace std; int leftOccur(int arr[] , int size , int key ){ int l = 0 , r = size-1 , ans=-1 , c = 0; while(l arr[mid]){ l = mid + 1 ; } else{ r = mid - 1; } } return ans; } int rightOccur(int arr[] , int size , int key){ int l = 0 , r = size-1 , ans=-1 , c = 0; while(l arr[mid]){ l = mid + 1 ; } else{ r = mid - 1; } } return ans; } int main(){ int key; int arr[]={0,0,0,1,1,1,1,1,1,1,2,2,2,2,2}; int size = sizeof(arr)/sizeof(int); cout
@PREETITECHNOLOGY
@PREETITECHNOLOGY 6 ай бұрын
Home work:- class Solution { public: int pivotIndex(vector& nums) { int total = accumulate(nums.begin(), nums.end(), 0); int leftTotal = 0; for (int i = 0; i < nums.size(); ++i) { int rightTotal = total - leftTotal - nums[i]; if (rightTotal == leftTotal) { return i; } leftTotal += nums[i]; } return -1; } }; tq sir.. for better understanding
@thenikhildaiya.
@thenikhildaiya. Жыл бұрын
Did the code part of 1st and 2nd question by myself after getting the approach. Thank you for so good explanation.
@ijunedaslam
@ijunedaslam 2 жыл бұрын
40:50 - HomeWork class Solution { public: int pivotIndex(vector& nums) { int rSum = accumulate(nums.begin(), nums.end(), 0); int lSum = 0; for (int idx = 0; idx < nums.size(); idx++) { rSum = rSum - nums[idx]; if (lSum == rSum) return idx; lSum = lSum + nums[idx]; } return -1; } };
@sushantchoudhary444
@sushantchoudhary444 Жыл бұрын
Easy approach for the 1st question pair p = make_pair(-1,-1); for(int i=0;i=0;i--) { if(arr[i] == k) { p.second = i; break; } } return p;
@rishabhsharma2046
@rishabhsharma2046 3 жыл бұрын
Bhaiya 1hr+ ke videos sw problem nahi h 😀😀❤️❤️❤️ Vaise bahut maja aa raha h ❤️
@shivamgupta78101
@shivamgupta78101 3 жыл бұрын
Bhaiya ab aap to "Bhaiya" se sir ho gye Congratulations... But jo bhi ho Amazing teaching methods Love you bhaiya....
@shixxam_prasad2049
@shixxam_prasad2049 2 жыл бұрын
Thank you, sir! This course is better than many paid courses
@funlearning5989
@funlearning5989 8 ай бұрын
video completed.... consistency is power...lets see the magic
@absarahmad8625
@absarahmad8625 2 жыл бұрын
bhaiya apki logic building strategy ekdam bawal h? Hats of u
@santanujana2001
@santanujana2001 3 жыл бұрын
sir kya vdo tha sir confidence agaya ab...... no matter how many thank yous i'll give you, this won't be enough. dil se dhanyebad sir itna achhe se complexity samjhane ke liye 🙌🙌🙌
@shaurabhmishra6029
@shaurabhmishra6029 2 жыл бұрын
I am actually enjoying a lot while following this DSA series.. the idea of giving homework and questions link in the description is very cool and time saving .....Thank you Bhaiya for your effort.
@kunalpramanick1050
@kunalpramanick1050 2 жыл бұрын
class Solution { public: int peakIndexInMountainArray(vector& arr) { int s=0,e=arr.size(); int mid=s+(e-s)/2; while(sarr[mid+1] && arr[mid]>arr[mid-1]){ return mid; }else if(arr[mid]arr[mid+1]){ e=mid-1; } mid=s+(e-s)/2; } return mid; } }; peak of a mountain of an array can also done by this
@krushimonpara1514
@krushimonpara1514 2 жыл бұрын
Bhiya apke explanation to next level hai maja a gaya ak time me hi pata chl jata hai full question.me iske sath sath apke 450 question vale dsa sheet ke question bue topic vice solve karta hu
@kiranbajetha8638
@kiranbajetha8638 Жыл бұрын
After two or three days, I am now able to solve these questions on my own- with lesser lines of code and an optimised solution..
@gammagyan9061
@gammagyan9061 3 жыл бұрын
batter than all coding gfg and ninjas
@Ayush_.
@Ayush_. 3 жыл бұрын
sach me bhaiya dill se thanks nikalta he aapka Course Hindi Medium walo ke liye bhi 1000%%% friendly he ❤️❤️ mene 1st day aapko Discord pe bola tha hindi friendly rakhna sir ,,, and you following that 😀 aapka nam hi hamari feelings bata deta he " always LOVE babbar" 😅❤️
@souravsanyal1617
@souravsanyal1617 Жыл бұрын
wow i can picturise every single explanation of you . thank you for uploading this useful lecture
@dbgaming7722
@dbgaming7722 3 ай бұрын
40:51 class Solution { public: int pivotIndex(vector& nums) { int total = 0; for (int i = 0; i < nums.size(); i++) { total += nums[i]; } int ans = -1; int rightsum = total, leftsum = 0; for (int i = 0; i < nums.size(); i++) { rightsum -= nums[i]; if (rightsum == leftsum) { ans = i; break; } leftsum += nums[i]; } return ans; } };
@AdityaSingh-nu8cv
@AdityaSingh-nu8cv 2 жыл бұрын
Marking my attendence it's day 5 and i'm super excited...
@VaradAdavkar
@VaradAdavkar 3 ай бұрын
Best c++ dsa course
@codeishard3182
@codeishard3182 2 жыл бұрын
When I start watching I don't understand and feel bearing then I wait and finally got the whole thing clear..... That's why I watch the full video though it seems not clear to me. Because I know I must understand...It's Babbar bhai...
@ShivamSharma-jm8cz
@ShivamSharma-jm8cz Жыл бұрын
you are the best bro... aapne bahut bahut bahut achcha course apne bana dia dia hai sabhi ke liye vo bhi free me aapke course kafi sare bade bade nami brands ke course ke takkar ka ya usse jada hi hai... love you bro
@youtubepro5005
@youtubepro5005 2 жыл бұрын
Raat m 1:00 am ho rha bhaiya ! Mzaa aa rha lecture bahot hi bole toh bahut hi jyada mzedar hai ! Love uhh bhaiya❤ !!
@anuragtiwari4182
@anuragtiwari4182 2 жыл бұрын
bhagwaan aapki saari khwahishein poori kare bhaiyaaa...god bless you
@arvind3570
@arvind3570 2 жыл бұрын
happy teacher's day bhaiya ji ❤❤❤❤❤❤❤❤❤❤❤❤❤❤
@abhishekgond7300
@abhishekgond7300 3 жыл бұрын
Ye huee n raftaar 🤩🤩🤩....waah bhaiya 🤩....Thanks.a lot ❤️👍
@silviusyt
@silviusyt 2 жыл бұрын
# find pivot in array class Solution { public: int pivotIndex(vector& nums) { int sum=0; for(int i=0; i
@siri_study
@siri_study Жыл бұрын
I rememeber not knowing what a vector is, and totally freaking out bcoz I couldn't solve one question also in the placements, but yesterday I solved an array question on my own in a test and I can't thank Babbar bhai enough for this playlist!!!!Thank you so much Babbar bhaiyya
@shaaniscoding
@shaaniscoding 28 күн бұрын
Pivot Question- Homework: class Solution { public: int pivotIndex(vector& nums) { int fsum=0; int lsum=0; int j=-1; int size=nums.size(); for(int i=0; i
@shashwathbhaskar673
@shashwathbhaskar673 Жыл бұрын
Brute force for finding first and last occurance #include pair firstAndLastPosition(vector& arr, int n, int k) { // Write your code here pair < int, int >ans; int min=0,max=0; bool flag = false; for(int i = 0; i
@deepakyadavYT
@deepakyadavYT Жыл бұрын
watched till end. Thanks a lot man for the efforts you've put in this course!
@hyderali1520
@hyderali1520 3 жыл бұрын
bhaiya aap aur aapka lectures super sa uper hai ,youtube pa dhmaka macha rahe ho .standing salute tou banta hai apka liya
@mdwaqar7401
@mdwaqar7401 Жыл бұрын
Quality at its Peak. Mountain of DSA Courses - Love Babbar Bhaiyya at the Peak. Thanks for another Great Lecture. 13 Videos completed.
@harshitsaxena6075
@harshitsaxena6075 3 жыл бұрын
Kya Samjhaya h bhaiya..well done. Please ye series continue rakhna.
@foccussed8872
@foccussed8872 Жыл бұрын
Most beautiful code explaination that i had ever seen.
@parasjain120
@parasjain120 3 жыл бұрын
Bhaiya bahut maza aaya waiting for 2nd and 3rd video of binary search question ,We love you bhaiya ❤️❤️❤️❤️
@rizwanali-is8nd
@rizwanali-is8nd Жыл бұрын
Bhaiya apky parhnaiy ka Method boht hi acha ha or Content ki quality boht hi achii ha Love you bhai Babbar... Bhai apko boht sa Piyaar Pakistan sy ....💌💌
@ashanhabib4195
@ashanhabib4195 2 жыл бұрын
Even i am Bangladeshi, but in your country everyone says that no one can learn DSA without knowing hindi🇧🇩🇧🇩🇧🇩Love you vieya
@pulipatijagruthi3016
@pulipatijagruthi3016 2 жыл бұрын
Everytime you say comment karke jaana, i feel like there are no words to tell you how blessed we are with your videos bhaiya😁
@sarvpriya5534
@sarvpriya5534 2 жыл бұрын
Total number of Occurances logic ((last-first)+1) will return 1 even when that number is not present in array.
Lecture 11:Time & Space Complexity || How to avoid Time Limit Exceeded [TLE]
29:12
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 14 МЛН
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 133 МЛН
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 60 МЛН
Coding Interviews Be Like
5:31
Nicholas T.
Рет қаралды 6 МЛН
Lecture 12: Binary Search Explained in 1 Video [Theory + Code]
38:41
CodeHelp - by Babbar
Рет қаралды 888 М.
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 744 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 14 МЛН