Recursion - Permutations (Theory + Code + Tips)

preview_player
Показать описание
This is part 2 of the subset + string recursion series. Here we cover some important tips to permutation problems with #recursion.

Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!

👉 Resources

=========================================
Timestamps:
00:00 Introduction
00:22 What is Permutation?
01:53 Permutation using Recursion
11:48 Code for Permutation
15:42 Returning output as an ArrayList
20:12 Counting Number of Permutations
24:35 Outro

#placement #dsa #interviews
Рекомендации по теме
Комментарии
Автор

It you don't understand in first watch, don't skip it. See it again, you will understand. In my case i was not able to understand in my first watch, when i repeat, i got the whole thing clear

subhankarkanrar
Автор

9:30 If anyone have the confusion with brackets, kunal mistakenly used Inclusive in place of exclusive bracket and vice versa.

PRASHANTKUMAR-ilob
Автор

The best recursion video ever! I have been watching all your recursion videos and I can now solve recursion challenges. Looking forward to more of these. Thank you for demystifying the monster!

muenidorcas
Автор

bhai top class :), gazab padhaye ho, recusrsion khud se sochna aagya, Thanks alot

nooruskhan
Автор

Logic becomes more clear after watching it again

MiddleClassBoy-lbyi
Автор

Your content is amazing, I went through lots of DSA courses on youtube, but no video develops the understanding and solution approaching mindset as you do. Blessed that I found you.🔥🔥🔥

yogpooja-vqpp
Автор

thanks kunal before watching your i have a lots of doubts related to permutation ... after watching video ... all doubt are cleared.

_PoojaDahifale
Автор

I did permutations just by seeing the previous video. Power of Kunal and recursive tree🔥🔥🔥🔥

manwinsingh
Автор

Thumbnail clears that the topic which we are going to see in recursion (recurring photos) LOL
Great work Kunal you're helping us in many ways. 😊

mayanksingh
Автор

it wouldn't hurt to leave a like. It is the least we can do for Kunal.

Cloud-
Автор

it is no way wrong if i say your lectures are really mesmerizing....just amazing Kunal #NailediT🔥

prakharsinha
Автор

Hi Kunal,

Your recursion playlist on YouTube has been a game-changer for me! I have learned so much and have been able to apply the concepts in my coding projects. I would love to see a new lecture series on dynamic programming. I know it's a challenging topic, but I trust your teaching style and explanations to make it more approachable. Keep up the great work!

hargunsingh
Автор

People in comments are all geniuses. (excluding me)
Most of them understood this at once.

I personally had to rewatch is many times and draw the recursion tree on notebook few times to understand it.

Great video Kunal.
Recursion is like that unless u do on paper few timess u dont understand.

akaay
Автор

You're helping me with backtracking so much. THANK YOU!!!

Moch
Автор

Been following the videos daily and keeping up with them. This is very fun ngl. Great work.

adityapalve
Автор

Hello Kunal. I want to know, After the DSA course, will you show us how to use our skills in open source and all that stuffs till how to approach in a company? If not then please consider this.🙏🙏🙏

sadmansakibmugdho
Автор

Thank you so much!!! <3 I FINALLY UNDERSTOOD RECURSION.

amruthaa
Автор

plss make more videos your way of teaching is just fab...

siddhigupta
Автор

Kunal, here is O(n) solution for permutation count -

int pc( str )
{
if ( str is empty ) return 0;
if( str.length() == 1) return 1;
int original_len = str.length();
int rem_len = pc( str.substring(1) );

return ( original_len * rem_len );
}

I am building my thought process ... thanks!!! ❤️❤️✔️

dark_techyy
Автор

simpler better code for permutation: static void permutations(String p, String up){
if(up.isEmpty()){
System.out.println(p);
return;
}
int n = up.length();
for(int i =0;i<n;i++){
char ch = up.charAt(i);
permutations(p+ch, up.substring(0, i) + up.substring(i + 1));
}
}

navrosesinghjohal