Been going on and off studying CS because I was stuck on recursion. Used to stop studying in a matter of minutes since I couldn't understand anything related to it. Watched 3 videos of your RECURSION PLAYLIST and now recursion is a cakewalk to me. The best 3-4 hours I've ever invested, not even capping
@@KunalKushwaha in 1:03:42 why is it returning [3, 4] and not [4, 3]....since its returning from the stack's top, it should first add 4 into the list n then 3 right?
Hey Kunal it has been a superb journey with you I got a job offer from Microsoft This is all because of your videos and your hardwork Thank a lot Kunal I will support you till my last breath
The part where this video leads to explaination of passing arguments as parameters avoiding multiple object creation made me feel I have to genuienly thank you! Highest of respect and Highest of Regards for what you have done. Thank you!
Mannnn, no matter how much striver, ye bhaia wo bhaia teach N queen or any difficult problem and boast about it.. this man teaches you what makes you solve these problems by self. It is not about solving one problem, it is about learning to solve many such problems.
bhaiya aapne bola tha ki recurssion me problem aayegi per mujhe to bahut easy lg raha hai ye.... maybe all because u are such a good teacher .. thakyou
Hey Kunal, you are such an amazing tutor. You think about all the perspective of watcher, like where they will get doubt and you are explaining it repeatedly without hesitation. Thank you so much Kunal.
Insane teaching man I was able to come up with my own solution in one line for linearsearch return index == arr.length ? false : arr[index] == target || linearSearch(arr, index + 1, target);
Bro please add the tree and graph videos as well.. I am 4 yrs experience at a service based org. But I must say you content is top notch in terms of explanation. I became fan of yours
One of the best courses I have come across so far. You are doing an incredible job. Just a suggestion. People who are having issues understanding the last return statement, try assigning a local variable to it and then return it, so you can see the stack getting cleared after each function call which makes it easier to understand.
Thank you for the amazing work you do. Another solution for question 5 is returning an empty list when the index is greater than or equal to array length instead of creating a new list in every call. def find_all_indcies(target, index): if index >= len(nums): return [] results = find_all_indcies(target, index + 1) if nums[index] == target: results.append(index) return results
Hats off to the efforts this guy has put in making these videos, Wish we had teachers like this in our collage. I wish you all the luck man and wish all your dreams come true.. Contributing to the better world. Thank you so much man
never thought these concepts would be so easy to understand bhai agar yhi videos khi hindi me upload maar diye hote to ajj tabahi ho jati cse field me .
By the time I had subscribed to your channel, I always wait for your next upload just a little request, just increase the speed of uploading videos. love you 3000 Kunal bhaiya
Hey, Kunal. Great Explanation. Especially the way you explained 'Return the list without passing the argument' was awesome and clearly understood. Great Work
@@JodFlashYT I have few of these. But not all. When I was taking the notes my handwriting was very messy as well. If you want to know anything then you can tell me and I will give you the fb or linkedin profile link.
One of the take aways is how to add a result of child recurrisve call to parent recurssive call and carry it forward adding again and again to a parent call !! New concept.. Liked your presentation, thank you !!
Man the dedication ur putting teach all these and ur notes is very much helpfull and ur teaching this for free hatsoff for u, ur best than many other paid courses at present . God ur kunal
Simpler code at 1:03:08 is - static ArrayList findAllIndexWithout(int[] arr, int start, int target){ ArrayList arrlist = new ArrayList(); if(start==arr.length){ return arrlist; } // this will contain answer for that function call only. if(arr[start]==target){ arrlist.add(start); } ArrayList ansFromBelowCalls = findAllIndexWithout(arr, start+1, target); // if current arrlist has no value then return the previous ArrayList returns. if (arrlist.size()==0){ return ansFromBelowCalls; } // if current arrlist is not empty then add all the elements from previous arraylist returns to the current arrlist // and return the arrlist. else{ for(Integer i: ansFromBelowCalls){ arrlist.add(i); } return arrlist; } }
in the Q 01, sometimes there will be cases where index and index + 1 will have the same value. for that case make sure to use this arr[index] arr[i + 1]){ return false; } } return true; } // using recursion public static boolean isSortedRecursion(int[] arr, int index){ if (arr.length - 1 == index) { return true; } return arr[index]
I think it's valid also: static List findAllIndex(int[] arr, int target, int index) { List list = new ArrayList(); if (index == arr.length) { return list; } List belowCalls = findAllIndex(arr, target, index + 1); if (arr[index] == target) { belowCalls.add(index); } return belowCalls; } p.s but reversing indeces
Mann you teach so awesome!!!!!!!, i was able to do the subsequence question by passing arraylist in the argument by my own because i had watched you arraylist video and as you keep on telling make the tree so i did that and was able to solve it , so happy mann!!
Your explanation is really great and I have so much fun watching your videos. Thank you for making a subject like Recursion understandable and entertaining for me.
Honestly :-> Your teaching way is fantastic and advance level. You are the real example of what's the knowledge we can get from youtube 💯 ❤ Love uhhh bro ❤
fun isSorted(arr: Array, prev: Int, next: Int): Boolean { if (next == arr.size) return true if (arr[prev] > arr[next]) return false return isSorted(arr, prev + 1, next + 1) } Can i call this as a pure recursion ? i mean when kunal said that question, immediatly this solution came in my mind
Between rotated binary search and recursive binary search which approach do we use in an interview? Love this course btw. Would love to see sliding window, 2 pointer, trees and graph questions
I was the person who didn't understood recursion and i left my DSA in between.. but now, after i watched your videos, its clearly understandable and i am able to make concepts on my own.. thanks kunal 💙 you deserve more success ✨ free content of Kunal>>>>>>> any paid courses.
Hey Kunal. Watched your Level 1 Questions video on Recursion and was able to solve one interview questions that I was asked in my interview. Unfortunately, I watched the video after the interview. But no worries. Really the way you're solving questions and explaining the thought process is really really beneficial. I also want to tell you that in the video you sometimes tell that it's too easy and doesn't feel like doing it but still you write the code and explain it. Please do that. It seems too easy for you but it's too difficult for people like me who are not that good at recursion. As you've solved those dumb questions and explained them. Hence, I was able to do some other questions also. This is helping me how to think in recursion. You're doing a fantastic job man! Excited to see your DP, Graph, Tree videos. ❤ I'm happy to tell you that you're not like other RUclipsrs and share incomplete knowledge. Kudos to your hard work ☮ 😃
Kunal is like, this is already covered this topic in the last video please check it out. I am not gonna teach you again. But he tries to teach that topic again, at least in short. :D Kudos to your efforts man.
I am not joking I don't know JAVA (only C++) still his explation are so accurate and the tips and theory this guy gives are so good .One of the best recursion playlist I have seen so far .Thanks Kunal for explaining in so much detail and giving so much time in this playlist .
DSA + interview preparation playlist: ruclips.net/p/PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ
This man is providing quality content for free...far better than the paid ones ♥️
He gets Powerfull blessings
i can personal vouch for it!!..
Agreed
but many important topics mentioned in website are missing, say maps, trees etc. hes also not interested to share.
No lies... Plus making seemingly hard concepts easy to grasp.
Sometimes it's that aura of Kunal which makes us comfortable in getting the hard concepts easily.
32:00 😁😁 "You've skipped the course I can't help you. Go watch the video properly" and then you says "ok, I'll repeat it."😂
he's the best teacher he just wants his students to not get confused
Been going on and off studying CS because I was stuck on recursion. Used to stop studying in a matter of minutes since I couldn't understand anything related to it. Watched 3 videos of your RECURSION PLAYLIST and now recursion is a cakewalk to me. The best 3-4 hours I've ever invested, not even capping
Glad I could help
I agree!!
Thanks kunal for all the videos .But please upload remaining videos after stack and queue as well
@@KunalKushwaha in 1:03:42 why is it returning [3, 4] and not [4, 3]....since its returning from the stack's top, it should first add 4 into the list n then 3 right?
@@meetabhashiniparida9417 if you haven't still figured out yet, then because call for index =3 will happen first and it will get added in arraylist.
your non formal and more friendly way of teaching feel very connected and its like you directly talking to a person
Hey Kunal it has been a superb journey with you
I got a job offer from Microsoft
This is all because of your videos and your hardwork
Thank a lot Kunal
I will support you till my last breath
Glad to hear that!
From Which College Are You?
Offer from these playlist only? Yes no doubt good playlist.
Your linked name please
Links
If anyone watches the first time, i will say , please see all the videos carefully previously and watch the full video. Don't skip anyone
bro did you understand recursion completely from his videos?
Increase the frequency of dsa videos Kunal🙏🏻🙏🏻🥺🥺
Yes! I agree
Nhi hoga. 🧹🧹
@@studyafa7159why not
@@studyafa7159lul
F = 1 / T but T is regular speed so it will be saame
Thanks Kunal, you're really a rare gem, I have understood recursion by just watching your contents
Excellent explanation for returning a list without passing an argument!
Starting Timestamp: 49:47
The part where this video leads to explaination of passing arguments as parameters avoiding multiple object creation made me feel I have to genuienly thank you! Highest of respect and Highest of Regards for what you have done. Thank you!
This series is hands down THE best videos on Recursion!! Thanks so much Kunal!!
Mannnn, no matter how much striver, ye bhaia wo bhaia teach N queen or any difficult problem and boast about it.. this man teaches you what makes you solve these problems by self. It is not about solving one problem, it is about learning to solve many such problems.
striver's playlist is complete unlike his
@@subhamsoni3853 Ah I seee. I completed from Aditya Verma and i come back to this to clear basic doubts.
@@subhamsoni3853 is this playlist really not complete? what is he missing?
bhaiya aapne bola tha ki recurssion me problem aayegi per mujhe to bahut easy lg raha hai ye....
maybe all because u are such a good teacher .. thakyou
You deserve a Big shoutout ❤️❤️❤️ for providing this type of quality education ..💯💯💯
Thanks for teaching us like no one did till now!! One small request, please make lectures on dynamic programming as well!!
Hey Kunal, you are such an amazing tutor. You think about all the perspective of watcher, like where they will get doubt and you are explaining it repeatedly without hesitation. Thank you so much Kunal.
Understanding recursion helping me to understand other data structures in detail and fast too
Thank you so much Kunal for providing quality content
when you understand the thing he is explaining totally, It feels so so satisfying
thanks for taking so much time for making this course its worth thousands of dollars and yet you made it free may god bless you.
No one explained Recursion as easy as you. Thanks a lot. A lot of paid courses doesnt explain Rescursion as you did.
You’re welcome
*C++ Code for returning vector without passing answer vector to the recursive function*
vectorsolve(int target, vectorarr, int index){
vectorres;
if(index==arr.size()) return res;
if(target==arr[index])res.push_back(index);
vectortemp = solve(target, arr, index+1);
if(!res.empty()) temp.push_back(res[0]);
return temp;
}
int main(){
vectorans = solve(4, {3,6,8,9,4,2,4}, 0);
for(int x:ans){
cout
My code for question at 3:18
public static boolean Check(int arr[]) {
int index = 0;
return helper(arr, index);
}
private static boolean helper(int arr[], int index) {
if(index==arr.length-1) {
return true;
}
else if(arr[index]>arr[index+1]) {
return false;
}
return helper(arr, index+1);
}
Guess what i checked every dsa course, really couldn't find anything better than this and anyone better than you kunal❤❤❤❤❤❤❤
Insane teaching man
I was able to come up with my own solution in one line for linearsearch
return index == arr.length ? false : arr[index] == target || linearSearch(arr, index + 1, target);
these playlist of recursion
deserve million of views
Bro please add the tree and graph videos as well.. I am 4 yrs experience at a service based org. But I must say you content is top notch in terms of explanation. I became fan of yours
The level of dedication and the quality of content💯.... TONS OF RESPECT AND SUPPORT ❤
One of the best courses I have come across so far. You are doing an incredible job.
Just a suggestion.
People who are having issues understanding the last return statement, try assigning a local variable to it and then return it, so you can see the stack getting cleared after each function call which makes it easier to understand.
yep, thanks!!
Your courses are the reason I bought RUclips premium😊
Thank you for the amazing work you do. Another solution for question 5 is returning an empty list when the index is greater than or equal to array length instead of creating a new list in every call.
def find_all_indcies(target, index):
if index >= len(nums):
return []
results = find_all_indcies(target, index + 1)
if nums[index] == target:
results.append(index)
return results
Bhaiya you are great aapki wajah se mera recursion itna best hoo gaya he ki me aab koisa bhi question bhot aaram se krr leta huu
You’re welcome
Hats off to the efforts this guy has put in making these videos, Wish we had teachers like this in our collage. I wish you all the luck man and wish all your dreams come true.. Contributing to the better world. Thank you so much man
Thanks a ton
never thought these concepts would be so easy to understand bhai agar yhi videos khi hindi me upload maar diye hote to ajj tabahi ho jati cse field me .
Hats off to his calmness, you are such a brilliant tutor, I am new to this channel, going to watch all the videos and learn different concepts..!!!
44:38
code in Python
def LiS(arr,target,index,NewList=[]):
if index==len(arr)-1:
return NewList
if arr[index]==target:
NewList.append(index)
return LiS(arr,target,index=index+1)
print(LiS([4,2,3,4,4,4,5],4,0))
Hey @Memestok, did you managed to write 1:03:10 code in python ?
November 7, 2021: 101,000 subscribers. Thank you Kunal
By the time I had subscribed to your channel, I always wait for your next upload just a little request, just increase the speed of uploading videos.
love you 3000 Kunal bhaiya
You are doing Gods work! So much knowlege with so much clarity for free. Thank you Kunal!
This man is making me fall in love with coding especially recursion
Best way to learn recursion anywhere. Thank you so much Kunal Sir 🙏
Hey, Kunal. Great Explanation. Especially the way you explained 'Return the list without passing the argument' was awesome and clearly understood. Great Work
So many things I have learnt so far. This is the best recursion content among all videos in youtube. Thanks a lot KUNAL.
Bro did you have handwritten notes of kunal it's giving me error in github 🥲 plz reply if you have
@@JodFlashYT I have few of these. But not all. When I was taking the notes my handwriting was very messy as well. If you want to know anything then you can tell me and I will give you the fb or linkedin profile link.
Recursion has been explained very nicely ,simple and understandable manner... Good work 🙂
One of the take aways is how to add a result of child recurrisve call to parent recurssive call and carry it forward adding again and again to a parent call !! New concept.. Liked your presentation, thank you !!
Bro simply increasing competition in the Industry!
you were right now i'm able to solve complex questions in my finger tips
told ya
Man the dedication ur putting teach all these and ur notes is very much helpfull and ur teaching this for free hatsoff for u, ur best than many other paid courses at present . God ur kunal
bro not many all
what a Quality Lectures.I never seen on RUclips
One of the finest content of the globe today
yay! just completed the vedio,now I am confident in solving recursion problems
I can't thankyou enough for this amazing lecture. I understood the whole lecture.
If you can make a lecture on DP it will be a big help.
Simpler code at 1:03:08 is -
static ArrayList findAllIndexWithout(int[] arr, int start, int target){
ArrayList arrlist = new ArrayList();
if(start==arr.length){
return arrlist;
}
// this will contain answer for that function call only.
if(arr[start]==target){
arrlist.add(start);
}
ArrayList ansFromBelowCalls = findAllIndexWithout(arr, start+1, target);
// if current arrlist has no value then return the previous ArrayList returns.
if (arrlist.size()==0){
return ansFromBelowCalls;
}
// if current arrlist is not empty then add all the elements from previous arraylist returns to the current arrlist
// and return the arrlist.
else{
for(Integer i: ansFromBelowCalls){
arrlist.add(i);
}
return arrlist;
}
}
😄
Classes are Extremely well......😍😍
in the Q 01, sometimes there will be cases where index and index + 1 will have the same value. for that case make sure to use this arr[index] arr[i + 1]){
return false;
}
}
return true;
}
// using recursion
public static boolean isSortedRecursion(int[] arr, int index){
if (arr.length - 1 == index) {
return true;
}
return arr[index]
I think it's valid also: static List findAllIndex(int[] arr, int target, int index) {
List list = new ArrayList();
if (index == arr.length) {
return list;
}
List belowCalls = findAllIndex(arr, target, index + 1);
if (arr[index] == target) {
belowCalls.add(index);
}
return belowCalls;
} p.s but reversing indeces
THANK YOU KUNAL for such an amazing content
Mann you teach so awesome!!!!!!!, i was able to do the subsequence question by passing arraylist in the argument by my own because i had watched you arraylist video and as you keep on telling make the tree so i did that and was able to solve it , so happy mann!!
Glad I could help!
Good Day!
Welcome back! Glad to see n hear you back!
🙏👌👌
Thank you for another excellent lecture. It helped me in getting better at recursion .You really know what you are doing.
it's like i am sitting in front of Kunal and he can see my expressions & he is scolding me that why are you not getting these simple concepts😂
concepts explained so well that I would remember for my lifetime
Recursion is a cakewalk now! you have my support till the end of times.
Thank You
guruji MIND IS BLOWN!
Your explanation is really great and I have so much fun watching your videos. Thank you for making a subject like Recursion understandable and entertaining for me.
3 comment...
But currently I AM doing sorting Assignment.....
I AM coming recursion as soon as ✨🤩🤩
Super bro...
The explanation of last question is amazing 🤩🤩💯💯
now its getting easier for me to solve recursion problem ... thanks ...
Honestly :-> Your teaching way is fantastic and advance level.
You are the real example of what's the knowledge we can get from youtube 💯 ❤
Love uhhh bro ❤
fun isSorted(arr: Array, prev: Int, next: Int): Boolean {
if (next == arr.size) return true
if (arr[prev] > arr[next]) return false
return isSorted(arr, prev + 1, next + 1)
}
Can i call this as a pure recursion ? i mean when kunal said that question, immediatly this solution came in my mind
Great explanation especially from 52 minutes onwards concept
Awesome explanation and tutorials!!! You made Data Structures, Algorithms, and Recursion dead easy!!!! God bless you beta...
last question
static int search(int[] n , int start , int end , int target){
int mid = start + (end-start)/2;
if(start==end && n[start]!=target) return -1;
if(n[start]==target) return start;
if(n[mid]==target) return mid;
if(target
A really nice work done by you brother...Really a best video of Recursion...
you made my life easy man. May the almighty GOD guide you to the right path.
Return the arrayList without passing in the parameter ..
Blow my Mind BRuuuuuuuuuuuuuuuuuuuuuuuuuuuuhhhhhhhhhhhhhhhhhhhhhhh.#3000
haha thank you
important parts:
41:16 khub sundor
49:47 (56:00)
Liked the video before watching...coz I know it's amazing ❤️❤️
1:01:34 Instead of creating list for each call we can return a clone of answer list and before returning we have to clear the answer list
WOWOWOW I understood the basics well now :D
Between rotated binary search and recursive binary search which approach do we use in an interview? Love this course btw. Would love to see sliding window, 2 pointer, trees and graph questions
Debugging makes learning easier .
Thanks for the tips .
See you later byeee, at 58:50 that's was so funny🤣🤣🤣 love the way you teach..❤❤🚀🚀
Thank you so much Kunal, You made this so simple.
array inside function body is the best part of the video;
Hats off kunal! take love from Bangladesh!
Best playlist for recursion🙌..
Thank you
This is what we need
Bhaiya please complete asap these course can't wait for more videos
Yes kunal plz
Yes my interviews are on the way 😶this is only hope for coding rounds...thanks for so far🙏
Yes kunal pls finish the bootcamp asap
No kunal bhaiya shouldn't hurry complete it fully
I was the person who didn't understood recursion and i left my DSA in between.. but now, after i watched your videos, its clearly understandable and i am able to make concepts on my own.. thanks kunal 💙 you deserve more success ✨ free content of Kunal>>>>>>> any paid courses.
Do the OOP video ASAP. Because lots of courses do the oop in early part of the course.
static ArrayList findAllIndices1(int[] arr, int target, int sIndex){
if (sIndex == arr.length)
return new ArrayList();
ArrayList list = findAllIndices1(arr, target, sIndex + 1);
if (arr[sIndex] == target)
list.add(sIndex);
return list;
}
Hey Kunal. Watched your Level 1 Questions video on Recursion and was able to solve one interview questions that I was asked in my interview. Unfortunately, I watched the video after the interview. But no worries. Really the way you're solving questions and explaining the thought process is really really beneficial. I also want to tell you that in the video you sometimes tell that it's too easy and doesn't feel like doing it but still you write the code and explain it. Please do that. It seems too easy for you but it's too difficult for people like me who are not that good at recursion. As you've solved those dumb questions and explained them. Hence, I was able to do some other questions also. This is helping me how to think in recursion. You're doing a fantastic job man! Excited to see your DP, Graph, Tree videos. ❤
I'm happy to tell you that you're not like other RUclipsrs and share incomplete knowledge. Kudos to your hard work ☮ 😃
Literally it's amazing 🤯
Kunal is like, this is already covered this topic in the last video please check it out. I am not gonna teach you again.
But he tries to teach that topic again, at least in short. :D
Kudos to your efforts man.
personal reference - 01:04:00
My solution for check sorted array problem
Def check(nums, i):
If len(nums) ==i:
Return True
If nums[I]
Thank you man❤
I am not joking I don't know JAVA (only C++) still his explation are so accurate and the tips and theory this guy gives are so good .One of the best recursion playlist I have seen so far .Thanks Kunal for explaining in so much detail and giving so much time in this playlist .
Wow, thanks!