Recursion - Level 1 Questions (Theory + Code + Tips)
In this video, we cover level 1 questions of #recursion. These are questions that will build the foundation of various concepts snd improve the thinking process. It will also set the base for future videos.
Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!
👉 Resources
- Join Replit: join.replit.com/kunal-kushwaha
- Complete Java DSA playlist: • Java + DSA + Interview...
- Code, Assignments, & Notes: github.com/kunal-kushwaha/DSA...
➡️ Connect with me: kunalkushwaha.com
=========================================
Timestamps:
0:00:00 Introduction
0:02:26 Revision
0:02:40 Q-01 : n to 1
0:08:52 Q-02 : 1 to n
0:15:04 Q-03 : Product of n to 1
0:23:37 Q-04 : Sum of n to 1
0:24:28 Q-05 : Sum of digits
0:30:42 Q-06 : Product of digits
0:31:56 Concept : Passing Numbers
0:35:19 Q-07 : Reverse a number
0:40:29 Way-1 for Q-07
0:48:20 Way-2 for Q-07
0:54:40 Q-08 : Palindrome
0:58:07 Q-09 : Count Zeros
1:08:05 Q-10 : Count Steps
1:12:41 Outro
#placement #dsa #interviews
Пікірлер: 707
Just the intro to recursion video was enough to solve all the questions in this video! I'm a beginner to recursion and felt like I've been doing this for months! *For people watching in future blindly trust this bootcamp!*
@KunalKushwaha
2 жыл бұрын
You're very welcome!
@shreyasingh4680
2 жыл бұрын
@@KunalKushwaha we can count 0 without helper function int cntz(int n) { if(n%10==n) return 0; if(n%10==0) return cntz(n/10)+1; else return cntz(n/10); }actually i am learning c++but in order to understand the approach i am here and its just amazing. thank u!
@venkateswararaothotakura945
2 жыл бұрын
@@shreyasingh4680 cntz(int n, c) If(n%10==n) return 0; rem=n%10; if(rem==0) return(n/10, c=c+1); return (n/10) ;
@Rajdweep
2 жыл бұрын
@@KunalKushwaha one qs bro if we r keeping the function void why are we taking extra functions extra variables etc?cant we just print n%10 and then write func(n/10) in the else part?i tried it and its giving same output in much less steps.
@shreyasgosavi9647
Жыл бұрын
@@Rajdweep Recursive problems can be solved in different ways, there is no single way to solve it. What's important is understanding the concept !!!🙌
I dont care what anyone say about kunal the only thing i know is that kunal is one of the best teacher and a mentor for students like me who cant afford udemy ot another paid course
bro's recursion videos are even longer than the other youtubers full java course. Excellent.
@mohamedirshaathm32123
6 ай бұрын
true
@lokesh8660
18 күн бұрын
check durga software solutions for java
From Pakistan, I started this boot camp 1 week ago, and boom! I have improved my logical thinking more than I have learned in the past 11 months! The best lectures!! very dedicated and knowledgeable instructor. Excellent💯
@anshulprakash6564
2 ай бұрын
Boom word was quite predictable
@itsdivanshugarg
2 ай бұрын
no offence but you could have just said that you didnt do shit in those 11 month lol😂 even if you had studied 40-60 minutes a day for 11 months, there is no way in hell you can improve more than that in just 1 week
This is the best playlist for recursion in all of KZread! Great job!
Hey Bro you just changed my perspective about recursion, I am the one who resigned programming at the time of recursion. But your course gave me lots of confidence about recursion so thank you so much you are doing great work.
@rahulkrishna8247
Жыл бұрын
The same happened to me as well Thanks Kunal!
Isse accha aur best recursion ka video ho hi ni skta pure youtube pr aisa video available ni h jo itna deeply samjhay aur aapki mehnat ko dekhne se lg rha h ki aap hme smjhane k liye kafi preshan to bhaiya mai apko bta du ki maine itne videos dekhe kisi ne bi itna acche se ni smjhaya . Aur apke video se maine recursion ko ekdam clear aur easy way me smjh lia . Thank you bhaiya❤❤❤ love you Aap aise hi videos bnate rho ❤❤❤❤❤❤❤ ❤
i was anxious if you ever abandoned this course , i geniunely got tears when i saw a new DSA video got uploaded thanks alot boss :D
@KunalKushwaha
2 жыл бұрын
I will complete it this month
@codingweb3904
2 жыл бұрын
@@abhishekc3556 i guess abdul bari sir, his teaching style is similar to abdul sir's teaching style.
@codingweb3904
2 жыл бұрын
@@abhishekc3556 yeah thats correct
@yashtalks7250
2 жыл бұрын
@@KunalKushwaha Bro lakhs of students career is dependent on this course... A big thanks from all of us.....
@swastikpatro6436
2 жыл бұрын
@@KunalKushwaha It's been over a month, the course is good, please upload more videos..
Thank you so much, Kunal. We really appreciate you taking your time and putting in efforts to provide us with the best content. I was actually able to solve all the questions before you explaining the solution. This is how great of a teacher you are.. Hats off!!!
Another great video from Kunal!! Very clear, and thought step by step! Thank you very much!
Best Course on DSA you ever find in the market! Thank You Kunal for taking the time and creating the course.
After watching the previous videos thoroughly, i did not face problem in any of the question of this one. You explain everything so well. You are a piro!😊
To be honest your videos on DSA are helping me a lot. I felt stupid when I started learning recursion, like why could i not understand. But after watching the first two videos I know that it requires time and dedication with exceptional teaching which you successfully executed. I really thank you and appreciate you putting in the time to help us understand DSA
Kunal your teaching style is alot different from hundreds of high qualified professors out there . Just finished with the lecture , it was really amazing, learning how to approach these problems . Good vibes only 😌😌
Simply the best on you tube, thank u so much for all the hard work you put to do all of this in so much detail. Appreciated a lot.
Kunal Bro You are one of the best tutor online I have ever found learned a lot from you thank you for being there !!!
I wish this course was a lil bit fast paced.......I'm really in need 🥺
@allaboutgamimg7976
2 жыл бұрын
@@suhaspatnaik Bro Link?
@KunalKushwaha
2 жыл бұрын
Will be completed this month
@allaboutgamimg7976
2 жыл бұрын
@@KunalKushwaha Thx bro for your hard work
59:25 alternate method (C++) int noOfZeros(int n){ if(n==0){ return 0; } if(n%10!=0){ return noOfZeros(n/10); } return 1+noOfZeros(n/10); }
My friend suggested this course and with the intro I am getting much more than I expected. Thank you Kunal )
Best content from the great mentor.. with a lot of patience.. ❤️
By seeing the last question, I understood how to approach the problem like kunal, and done it. This is literally the best course one can ever get. Thanks Kunal...
It's a great video! I was quite skeptical about recursion but this video has boosted my confidence! Kudos to you!
To be honest your videos is 🔥 and helping me a lot. I felt stupid when I started learning recursion, like why could i not understand. But after watching the first two videos I know that it requires time and dedication with exceptional teaching which you successfully executed.
Kunal is Gem of Person ❤️ Doing such a great work which is helping thousands of students right now !!
Can't thank you enough. Your efforts are visible .Extremely thankful to you .
You are the best teacher i have ever came across in my life.. ❤
Just finished the video and was able to do all the questions by myself just cause I revised the notes that I made in the recursion basics video. What a brilliant way to teaching man! Hats off to you!
Million heart smiles come when ur videos come
Because of these classes understood the recursion very easily. You are awesome Kunal. Thank you very much for this. :) :)
Like you are saying you will upload all the remaining ds lectures within this month, I can guarantee you will have more 100+ subscribers from my college only . Also you will eventually cross the 100k subscribers marks definitely in this month only 🔥🔥🔥
@radhekrishnamishra5371
2 жыл бұрын
Full support to you bro,bcuz of you I am attempting Java questions I owe you and I will make up it by adding 100 subscribers in your channel brother
@udaysingh2929
Жыл бұрын
Not completed the course 🥲
@user-om7vk9gk5k
Жыл бұрын
@@udaysingh2929 ongoing when ever he is free he will do just like uploading stacks and queues in last 2 months
Thank you Kunal. I' finally able to solve questions on my own. Gem of a teacher! ❤❤
Thanks, Kunal, I just followed your teachings while coding in JavaScript, and even though I believe you use Java, I could do exactly with your pseudo code provided in your worked examples. Thanks, a lot
Thanks Kunal for making this recursion playlist...you have made recursion so much understandable. And to all who want to understand how actually recursion works then this is the only playlist you need. I haven't seen anyone who is debugging and showing all the process behind the scenes. And now I can correct my mistakes myself by debugging and it's a great feeling...so again thank you brother for making amazing content. You are doing great work...keep going and I hope you will continue and complete this playlist because I don't want to learn from any other resources...lol
Excellent Kunal !! You are just amazing. You try really really hard to make us understand in free. Can’t thank you enough. For your such hard try to make us understand unlocks our potentials to solve a problem. Just a new subscriber of you but still now I also tried to solve the Reverse a Number in a different way. static int reverse(int n, int res){ if(n==0){ return res; } res = res*10 + n%10; return reverse(n/10,res); } caller function: reverse(1324,0)
I solve the last question by myself though its easy but approach was same as you taught, You are great teacher I wish and hope you publish video everyday
Excellent Kunal beta , you made RECURSION easy!!! You rock!! God bless you!!
The introduction to recursion video is enough to solve all the questions... Great video excellent content. Keep it up bro!
woahhh !! Really great never thought recursion will be this easy.Kudos to you brotherr!
Was confused with submissions in Leetcode, the helper function cleared everything. Thank You!
true kunal what you said, stayed with you through the series and I feel so so much more confident with recursion now! Thank youuu! 😃
Maza aayaa....aur ye maza har programmer ko lena chahiye😆😆😍👍👍👍👍👍
The more we wait for future lectures, the better it gets 🥳
Amazing explanation kunal ! I easily solved the questions on my own then checked your solution, they match quite a lot.
Thanks for teaching us like no one did till now!! One small request, please make lectures on dynamic programming as well!!
Thanks for the amazing content Kunal even we can't find these kind of qualified videos in paid courses too please do more videos on the recursion topic this is really the most confusing topic for us
Hey kunal! The way of your teaching is surely amazing and you know what no-one i repeat no one can explain things like you... lastly thnx so much for this bootcamp....you killed it ❤
This man is fkkkkinnnnngggg legend..... I cant believe i solved in a row every problem without seeing his solution 😮
we can also solve the count zeroes question without taking an extra argument or helper function like the below way: static int count(int n){ if (n == 0){ return 0; } if (n%10 == 0){ return 1 + count(n/10); } return count(n/10); }
@ihsannuruliman3656
2 жыл бұрын
with the helper the runtime and memory usage are usually better
such a great lecture ...man just love your teaching style❤️❤️....also bring the Dynamic Programming lectures soon.......
Bro you are really like a magician 😂 ...you are teaching every critical problem just like easy peasy ...within seconds❤love you dada 🙏 love from bengal
Excellent lecture kunal bhaiyya!... This video helped me a lot... Thank you so much... appreciated...!
How interesting it would be if our professors would adopt such teaching skills🤩
kunal within a week i completed 27 videos now u r the best teacher.....
The examples provided are indeed suitable for beginners and can help them understand recursion more deeply. It helped me to get better understanding of the topic.😃
short of words for this man.... kudos to bhaiya for teaching this concept with such ease..
Never thought that after purchasing paid courses from GFG and Coding Ninjas I will come here and clear out my doubts on recursion. I think the differentiating factor is also your crystal clear art of communication ....Thanks for making this video exist free for everyone.
Video description is 100% Justified !!!!!!!!! - These are questions that will build the foundation of various concepts and improve the thinking process.
Just completed this lecture, once again great explanation.
you simply changed my thought process about recursion.
Bro, the concept of an helper function is a game changer
Feeling better about recursions now !
Very nice explanation on every question. The most valuable thing is that you want us to think and not only solve the problem.
Awesome videos, I am learning recursion very well here, Krunal you are a fantastic mentor
Crystal clear explanation , Got the hint of Math.log10 and solved this question myself reverse(4326) using recursion function reverse(n) { if((n%10) === n) return n; const numberOfDigits = (Math.floor(Math.log10(n))+1); return (n%10 * Math.pow(10, (numberOfDigits-1))) + reverse(Math.floor(n/10)); } console.log(reverse(4234));
Hey Kunal very much impressed with your extraordinary teaching and problem solving concept. Although I've learnt through many mentors but you are different from all of those!!!! Please complete you DSA course as I am not watching any other DSA video. Hindi m bolu to " tmhari videos dekhne k baad kisi aur ka samjh hi nhi aarha "
This sneak peak really works thanks Kunal - base case, statement, return type
I have a lot of fear regarding Recursion. But now it seems easy peasy. Thank u so much.
Bro,I admit that your way of explaining is to next level which makes a difference b/w u and others
Truely ! Kunal bhaiya i was'nt able to solve the recurrsion but through these video i have make my base strong . I completed these video and going to the next video of yours .
from your previous recursion lecture, you mentioned about writing the flow on pen and paper. This helps Kunal, thank you!
Recursion made really easy 🙂 ..Great explanation in easy to understand manner...good work
Good beginner level examples on how to think of recurssion and go about implementing it.
hey kunal i have a very small code of reverse number recursion without any special function. public static void main(String[] args) { Scanner sc=new Scanner(System.in); int num=sc.nextInt(); int reverse=reverseNumber(num,0); System.out.println(reverse); } public static int reverseNumber(int num,int sum) { if(num==0) return sum; sum=sum*10+num%10; return reverseNumber(num/10,sum); }
You nailed it bro literally nailed it, how easy you made it to understand. Thank you.
I am so blessed I found you and came to know about how things work, not only like this dsa and java but everything, open source - learn in public- different tech - focus on skills rather than becoming topper in clgs - so on... in 1st year itself Thanks thanks thanks bhai naya shbd banao, sab logoke thanks sunke kantal gaye honge xD
Introduction of recursion asa acha tha ki me iss lecture ka sab question khud se solve kardia.thank u kunal
@KunalKushwaha
10 ай бұрын
noice
Actually, I was thinking of quite the DSA due to recursion. But now I am confidentially saying I am going nowhere. Thank you, man. Love you!
Hi kunal, your content is too much useful request you to plz try to upload recursion videos on daily basis so that this topic will cover soon.
I just can't thankyou enough for this video , it boosted my confidence in recursion very much. This recursion series is the best guyss .😇
The flow of explanation was lit and please I request everyone don't be sacred by looking time, each and very second of the video was very helpful woowwww🤯🤖🤝
Amazing bootcamp yo do question with him thats he make simply easier .I join few week no of questions he is doing make simpler and easier to read and understand kind of take a pen in your hand make you do programe tonns of good wishes for you to make this bootcamp simply different for beginner so they can a boost of confidence and they go a right way. Thank you 😀
Bro, you nailed it, I had collected the problems of these all paid courses(popular) on the internet and some popular KZreadrs and started learning. I found that your playlist combined these all questions with in-depth solutions. This is really the best course of recursion on the internet.
thank you so much Kunal Bhaiya..you are truely saviour...and hope for students like me of 3rd tier college
one of best lecture on recursion have ever seen(last example)
the last two question gave me GOOSEBUMPS🔥
thankyou so much Kunal for the amazing explanation.
I had a small doubt in the last two questions adding else to the if made less function call I guess. because while returning it again goes into the loop and then comes after hitting the termination condn. Am I right or thinking the wrong way?
thank you soo much ...it helped me a lot....you deserve a lot of appreciation brother....keep uploading...
Amzing content!!..Keep up the great work..just wanted to know if you will be providing content on web development
Excellent lecture!Thank you so much kunal bhaiyya... this helped a lot...
you are amazing kunal as per usal , but in Q7 the second way we can do it witout a helper function public static int reversenum (int n){ if(n
Followed kunala advice to make recursion trees for understanding and believe new it became lot easy to understand and code it after I did it.....if you are reading this I will suggest the same as Kunal suggested to make a recursion tree and see how the recursion calls are happening.
Kunal, it's just just awesome, whenever you say it's the best course on DSA then you mean it, will recommend everyone to give it a try at least, and I promise you won't regret it later
@KunalKushwaha
2 жыл бұрын
Thank You
@xaviball2911
Жыл бұрын
you are intern at google?
awesome 😎 he is man of his words which makes big difference : trust him his making it simple and easy to learn just follow the course
fantastick i never ever seen the explain given like you
super explanation, you made tough topic as interesting. Thank you!!
Rock star: Great great effort. no words to say you kunal. Thanks a lot for these videos
Q9. Count the number of Zeros in a number. I love the lectures from Kunal. I actually came up with a better solution for the problem: public int count0(int n) { if (n == 0) return 1; if (n
recursion made easiest and fun
cant believe I solved recursion problem without any help thanks!