This playlist is still best material on youtube even after 3 years no one is able to match this level
@iqrarahmad266916 күн бұрын
concept will always be same, so it will be top notch even after 100 years
@babbarutkarsh77704 жыл бұрын
I coded 100% myself and it was correct, you teach concepts which none other does. Halwa lagra hai recursion ab.
@TheAdityaVerma4 жыл бұрын
Thanks brother, do share with everybody you can !! And let's together make this channel the best channel for interview preparation on youtube, shall we? ✌️❤️
@babbarutkarsh77704 жыл бұрын
@@TheAdityaVerma we will for sure.
@pleasesirmorevideos46844 жыл бұрын
oh bhai khaa mat liyo
@bhaskarbhakat56894 жыл бұрын
@@TheAdityaVerma linkedin hila kr rakh deya h apne... Awesome bhai
@deveshkumar28624 жыл бұрын
Can you send the code of this. I understood but I want thid code can you write the code in comments box please
@sairajdas66924 жыл бұрын
I was able to code this without completing the video. I can't believe it, watching your videos really changing me. Can't thank you enough.
@tejasjhamnani77243 жыл бұрын
Same bro
@shashwatsingh2532 жыл бұрын
Hume belive nhi ho raha ki recursive tree banane ke baad hi mai apne se code likh paya.... Thank You Aditya Bhaiya....
@vishalwagh4782 жыл бұрын
Till date this subset & permutation or recursion was damn tough for me.... After watching your IBH & choice diagram....Really things become easy.... You are the real geek... !!!Kudos
@samikshagupta783 жыл бұрын
Your content is just fabulous! I can not express the happiness and confidence i feel after watching your videos. You are the best teacher out there. You are an inspiration. Can't thank you enough for the hardwork you do for us. Just a request.. please consider Trees, Graphs and Backtracking videos asap. PLEASE!!!
@RohitKumar-fy9fp Жыл бұрын
same samikhsha 🥰
@123akash1213 жыл бұрын
"par samajh me zaroor aa jata hoga", haan bhai sach me samajh me zaroor aata hai, itna accha samajhaya iss pure series me ki code toh ab khud sehi likh leta hoon (par phir bhi video pura dekhta hoon, you're an awesome teacher bro)
@akashrajput37314 жыл бұрын
Hey Adiya Try to make atleast one video on linked list based on recursion.........Btw thanks for providing such a awesome content
@deveshkumar28624 жыл бұрын
Can you send the code of this. I understood but I want thid code can you write the code in comments box please
@@deveshkumar2862 TWO APPROACHES : github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Backtracking/Split%20a%20String%20Into%20the%20Max%20Number%20of%20Unique%20Substrings
@HemanthaKumarYadav3 жыл бұрын
Thank God, I have found your channel! never understood recursion this well !
@souravmajumder65984 жыл бұрын
In one word, you are just awesome ❤ You make the hard things pretty easy. Take love from Bangladesh ❤🇧🇩 Waiting for Backtracking.
@BECSAQUIB2 жыл бұрын
Aditya bhaiya , You have a great teaching skills. No one is providing such unique content. Thanks a billion!!!
@SnehJoshi193 жыл бұрын
Such a beautiful explaination, you made recursion like a "CakeWalk".
@p210724 ай бұрын
i was able to code it up myself only because of your previous videos in which you made recursion look like such an easy topic thank you
@RadhikaAmarDesai22BCE1112 ай бұрын
bhaiya sirf apki wajahse I can write recursive code like I am doing some magic. maine kabhi nahi socha tha I would be able to code this question without even seeing. I hv been struggling with recursion since 1st year. Abhi 3rd year mein sab samaj aa raha hai. Love you
@harshthakur98902 жыл бұрын
maine iska code khud se kar liya...i cant believe, thank you so much bhaiya.
@codeout85293 жыл бұрын
Your way of teaching is awesome. 5 minutes into the video and I have already coded it correctly fully myself.
@rishabsharma53076 ай бұрын
Thanks Aditya. I was able to solve this problem on my own. ``` vector result; void solve(string &str, int n, string temp) { if(n == 1) { temp.push_back(str[0]); reverse(temp.begin(), temp.end()); result.push_back(temp); return; } temp += str[n-1]; // Correctly append the character from str. solve(str, n-1, temp); temp += " "; // Add a space as a separate operation. solve(str, n-1, temp); } vector permutation(string S){ // Code Here solve(S, S.size(), ""); sort(result.begin(), result.end()); return result; } ```
@yashvirsinghnathawat16874 жыл бұрын
We want Backtracking as well....Great Effort It really means a lot.
@RohitKumar-dz8dh2 жыл бұрын
Kya kahu ab mai wo perfect word hi nahi hai mere paas apke appreciate k liye , apka recursion tree ko trace karke usko code me implement karna FAN ho gaye hum apke , pehle me recursion code ko dekhkar uska recursion tree banata tha fhir usko trace karta tha ki code kese work kar raha par usse recursion ka implementation nahi sikh paya par ab apne mujhe recursion tree banana sikha diya aur ab me khud hi implementation kar sakta hu . Charan kha hai apke guru ji 🙇♂️🙇♂️🙇♂️🙇♂️
@nrted38773 ай бұрын
aditya bhai, god of recursion and dp
@anshulrohira8824 жыл бұрын
Very good content , believe me this is my first ever comment on any platform , love ur explanations , specially like the way you define patters for questions , eagerly waiting for backtracking and graph
@deveshkumar28624 жыл бұрын
Can you send the code of this. I understood but I want thid code can you write the code in comments box please
@@deveshdubey6776 no bro it's okay thanks Yaar . I am grateful to you bro
@ryzingcode11312 жыл бұрын
I haven't seen anyone with such deep way of teaching thing.
@DidYouKnowThis.3 жыл бұрын
This is indeed the best channel for placement preparation..U have made our lives easier with recursion ,,Thank you very much brother 🙏.
@divyanshmishra86153 жыл бұрын
Honestly speaking brother.... recursion used to haunt me, but now i am becoming better, running my logics through these problems ..........nobody till now has explained recursion in such a depth
@sahilanand302 жыл бұрын
This videos are evergreen This is gonna to be remembered for centuries Mark my words People will watch this videos after centuries because this level of explanation is done only by @Aditya Verma sir
@balidinesh56874 жыл бұрын
ThankYou!!!!!! so much I struggled for one month to get this type of recursion tree(ip-op)method but now I got the confidence to solve on my own.
@yadneshkhode30913 жыл бұрын
THANK YOU BHAI khudse hi code likh liya question dekhneke baad
@yadneshkhode30912 жыл бұрын
sabbash kachra sabbash
@pranjalck2 жыл бұрын
Gonna rock in placements if being attentive to ur playlist.. thnq.. bro!
@tempregex85203 жыл бұрын
Hello Aditya! thank you for starting this channel, a superb reminder that how weak are my concepts. I had a suggestion, do you mind just mentioning the runtime + space complexities at the end(not sure if you do have it in the patreon notes)? i think thats the only missing part that i found in your videos(not all of them, but some of them). Just a suggestion. Thank you for all your time and efforts in making and giving us access to this content.
@paritoshdadhich29543 жыл бұрын
I coded this question by myself, earlier I scared a lot while solving recursive problems. Now I getting more confident. thank you for such a great explanation. Mazza hi aagaya bhai
@mayankgautam42664 жыл бұрын
Thanks bhaiya!! When I was watching a 1st video you was saying multiple time after creating a recursive tree then code likhna will be a cakewalk :) Now a realized that after creating a recursive tree then code likhna is just like a cakewalk:-)
@ankitsoni33884 жыл бұрын
Bhai pyaar hai tu. Thanks for taking out time for all of this.
@mansimaurya42764 жыл бұрын
Please make a series on graph..Ur content is really helpful..thank u for such good explanations
@RiteshYadav-rc1np3 жыл бұрын
man man man !! you are just awesome thank you for this, recursion is a cakewalk now
@himanshumehndiratta71244 жыл бұрын
Kasam se sare code apne aap ho rhe hain ab. Best explantion bro.
@harjos783 жыл бұрын
Aditya you are born to teach .... hats off man!!. simply awesome
@abhigyansharma91083 жыл бұрын
KING OF RECURSION- ADITYA SIR OP
@rishabhgupta7343 жыл бұрын
re devaaaaaaa.... ae shyaam ,aditya bhai ko thank you bol...
@AnshuKumar-zn1qb3 жыл бұрын
Bhai itna easy way me recursion padha diya aapne... Thanx a lot
@tanujabharti80434 жыл бұрын
One can code only by following your explanation....no need to see code :) Great explanation!!!
@adityagore2147 Жыл бұрын
really dig the song that plays at every lecture's end 😎😎❤❤
@ishanikasingh93213 жыл бұрын
majboori me padhna shuru kiye the, ab majaa aaraha hai ;)
@Sabudan3 күн бұрын
Best explanation ever❤
@willturner34404 жыл бұрын
Khud se kar lia mene vo bhi bilkul sahi, thnks bhaia ab graph pr bhi video bna dijea
@AshishKumar-xg8dm4 жыл бұрын
Your input.. output trick is crazy...
@sarthakbhatia78884 жыл бұрын
Thanks a lot man....I was just scratching my head through this question
@pulkitchausali13543 жыл бұрын
thanky bhai helps a lot i was getting problem in starting of tree then my whole problem solved
@FrustratedEngineer_3 жыл бұрын
Baat toh sahi hai aapki .. Isse better koi nahi samzha sakta ..
@praphulyadav44713 жыл бұрын
bhaia you are a great teacher you made such a hard topic so easy thanku very much
@livelypooja2 жыл бұрын
Everything is good but you should give a glance to code also it helps in understanding better
@MohitGupta-ri9hf4 жыл бұрын
Hey Man, Believe me, this channel is going to be the go-to choice for students!! Kudos to you and I appreciate your hard work soon you will be rewarded with millions of subscribers.
@yashgupta96774 жыл бұрын
Coding God one series on backtracking please!!!!! 👏👏👏👏👏👏👏👏👏👏👏👏👏👏👏👏👏
@Devesh121 Жыл бұрын
thanku so much bhai you are gem brother bhai kam se 1 million to hona chahiye ab
@shritvaagarwal6143 жыл бұрын
now i am able to think recursively. Thank youu
@dimpleshah65383 жыл бұрын
Smooth Explanation.. I was able to write the code myself.
@varungoel69813 жыл бұрын
How about using char first and then appending '_' , instead of appending first '_' and then char. In this way code would become more generic and understandable. Here is my code:- #include using namespace std; void printPermutationWithSpaces(string input,int currIndex,string output){ if(currIndex == input.length()-1){ output+=input[currIndex]; cout
@shubhamjaiswal23143 жыл бұрын
Isse easy koi ni samjh aa skta VERY TRUE 🤟🤟🤟🤟
@ichigo_kurosaaki8 ай бұрын
class Solution{ ArrayList permutations; ArrayList permutation(String S){ permutations = new ArrayList(); helper(S, S.charAt(0) + "", 1, permutations); return permutations; } void helper(String original, String permutation, int index, ArrayList result) { if (index == original.length()) { result.add(permutation); return; } helper(original, permutation + " " + original.charAt(index), index + 1, result); helper(original, permutation + original.charAt(index), index + 1, result); } }
@jain007neeraj4 жыл бұрын
@Aditya Did you remove Print Unique SubSet video?
@tushargogiya40179 ай бұрын
After learning last video i am able to do this question without watching current video .Above it is GFG question C++ Code class Solution{ private: void solve(string s,vector & ans,string temp) { if(s.length()==0) { ans.push_back(temp); return ; } string temp1=temp; string temp2=temp; if(temp.size()==0) { temp1+=s[0]; s.erase(s.begin()+0); solve(s,ans,temp1); } else { temp1+=' '; temp1+=s[0]; temp2+=s[0]; s.erase(s.begin()+0); solve(s,ans,temp1); solve(s,ans,temp2); } } public: vector permutation(string s){ vector ans; string temp=""; solve(s,ans,temp); return ans; } }
@aadarshtiwari34993 жыл бұрын
Eagerly waiting for the Backtracking playlist .
@kzr_5674 жыл бұрын
Can you please make a video on simple permutation of a string.. Im really confused how to approach it
@holy_jayden3 жыл бұрын
What else you can do is, so that you don't need to change main() function [ insert 3 Lines of code in previous video's code ] String op1 = op; op1.push_back(ip[0]); // Line 1 String op2 = op; if(op.length() != 0) //Line 2 { op2.push_back( '_' ); //Line 3 } op2.push_back(ip[0]);
@sarthaksarangi Жыл бұрын
Java Solution public static void permutationWithSpaces(String s, List ans, StringBuilder op){ op.append(s.charAt(0)); if(s.length()== 1){ ans.add(new String(op)); return; } //Choices =2 //Either include the Character with space or just include the character //Including the character with a space s = s.substring(1); permutationWithSpaces(s, ans, new StringBuilder(op).append(" ")); //Not including the character with a space permutationWithSpaces(s, ans, op); }
@TulitPal3 ай бұрын
Java code to help anyone confused 😊 class Solution { TreeSet set; ArrayList permutation(String input) { set = new TreeSet(); ArrayList list = new ArrayList(); String output = input.charAt(0) + ""; if (input.length() == 1) { list.add(output); return list; } constructPermutations(input.substring(1), output); for (String ele : set) list.add(ele); return list; } private void constructPermutations(String i, String o) { if (i.length() == 0) { set.add(o); return; } String op1 = o.concat(" " + i.charAt(0)); String op2 = o.concat("" + i.charAt(0)); constructPermutations(i.substring(1), op1); constructPermutations(i.substring(1), op2); } }
@AnkushKumar-mk8ns4 жыл бұрын
Bhai backtracking ki series laoge na? Next topic kaunsa aa rha h recursion ke baad?
@ganeshmoota73493 жыл бұрын
Java Code: public static void permutationWithSpaces(String ip,String op){ if(ip.length() == 0){ System.out.println(op); return; } permutationWithSpaces(ip.substring(1),op + ip.charAt(0)); permutationWithSpaces(ip.substring(1),op + " " + ip.charAt(0)); } public static void main(String[] args) { String ip = "ABC"; String op = ""; op += ip.charAt(0); ip = ip.substring(1); permutationWithSpaces(ip,op); }
@shivoham59399 ай бұрын
tc kitna hain ji is code ka
@nikitajaiswal91122 жыл бұрын
beginners who don't understand this series first time please watch again and again and view whole series with sequence u can able to make solution by your own.
@dhairyaanchal86232 жыл бұрын
This is the python code below:- def solve(input, output): if(len(input)==0): print(output) return output1=output #initialisation output2=output #initialisation output1=output1+"_" #if we include space output1=output1+input[0] #include from input output2=output2+input[0] # include from input input=input[1:] solve(input, output1) solve(input, output2) input="ABC" output=input[0] input=input[1:] solve(input,output)
@adityakumarpandey58173 жыл бұрын
i coded 100% myself : void solve(string ip, string op, vector&ans, int i ){ if(ip.length()==1){ ans.push_back(op); return ; } string op1=op; string op2=op; op2.insert(i," "); ip.erase(ip.begin()+0); solve(ip, op1, ans, i+1); solve(ip,op2, ans, i+2); } int main(){ string ip="ABCD"; string op=ip; vector ans1; int i=1; solve(ip,op,ans1, 1); for(int i=0; i
@hemantmarve36744 жыл бұрын
Awesome Explanation.Thank You Bhai.
@NikhilSingh-dr3ig2 жыл бұрын
If you don't want to make two extra strings in recursion and erase the string follow this: void solver(vector&ans,string sol,string s,int i) { if(i==s.size()) { ans.push_back(sol); return; } if(i
how to memoize this for longer inputs. For eg. If the string len is more than 30 or 40 chars. This can throw memory limit exception.
@ayushijindal4898 Жыл бұрын
I have tried the question with two approaches second recursion function approach is same as discussed in the video public class PermutationSpaces { public static void printPermutationSpaces(String str, String ans) { if(str.length()==0) { ans =ans.substring(0,ans.length()-1); System.out.println(ans); return; } for(int i=0; i
what else we can do is first put all spaces in between, ,then in recursive tree make decision to remove space or not...btw your video is always awesome
@_SurajGupta Жыл бұрын
I have a doubt(please if anyone can answer) If I pass the input by reference its giving wrong answer why?
@akshitajha1209 Жыл бұрын
Same doubt
@abhishekkapoor6923 жыл бұрын
simple ho gaya yaar....thanks bhai
@abhishekkapoor6923 жыл бұрын
@@anchaldevrani2055 email?
@vladimirputin2756 Жыл бұрын
public class permutationWithSpaces { // Recursive function to generate permutations with spaces. public static void helper(String input, String output) { // Base case: If the input string is empty, print the current output. if (input.length() == 0) { System.out.println(output); return; } // Take the first character from the input. char ch = input.charAt(0); // Create two branches: one with the character followed by a space, // and one without any space. String newInput = input.substring(1); String pickWithSpace = output + "_" + ch; String pickWithoutSpace = output + ch; // Recursively generate permutations for both branches. helper(newInput, pickWithoutSpace); helper(newInput, pickWithSpace); } public static void main(String[] args) { // Input string and initial output. String input = "abc"; String output = ""; // Extract and remove the first character from the input. char firstChar = input.charAt(0); output += firstChar; input = input.substring(1); // Start generating permutations with spaces. helper(input, output); } }
@easycoding5914 жыл бұрын
Brother you deserve more subscriber than love babbar
@bhaskarbhakat56894 жыл бұрын
Love babbar is our guide and aditya verma is our mentor...
@rishabsinha87494 жыл бұрын
They both are good content creator and both are at their best at what they do.
@ssquare14 жыл бұрын
Flipkart vs Amazon lol
@nishantpratapsingh31724 жыл бұрын
@@ssquare1 😂😂😂
@Finn-jp6pn4 жыл бұрын
Here's the Java Code for the problem if any one needs it public static void permutationWithSpaces(String input, String output) { if(input.length() == 0){ System.out.println(output); return; } if(output.length() == 0){ output = input.charAt(0); input = input.substring(1); } String output1 = output + input.charAt(0); String output2 = output + " " + input.charAt(0); input = input.substring(1); permutationWithSpaces(input,output1); permutationWithSpaces(input,output2); }
@bairagisirfire21854 жыл бұрын
output = String.valueOf(input.charAt(0));
@_AnuragSharma Жыл бұрын
Why did you leave making videos your content was so good
@kishanmishra98024 жыл бұрын
Great teacher
@yashnagda93633 жыл бұрын
My python code: def solve(inp,output,original_length): #base condition(finiding output when inp is empty at leaf if len(inp)==0: print(output) return #inital case for first character. adding without space only if len(inp)==original_length: output=output+inp[0] inp=inp[1:] solve(inp,output,original_length) return output1 = output + " "+inp[0] output2=output+inp[0] inp=inp[1:] #two cases adding without space and with space solve(inp,output1,original_length) solve(inp,output2,original_length) return inp = input("enter your string!\t") output="" solve(inp,output,len(inp))
@aartikumarisingh99294 жыл бұрын
sir you are simply awesome!!
@aartikumarisingh99294 жыл бұрын
i write the whole code by myself ! thank u sooo soooo much!
@pankajkadian46234 жыл бұрын
Brother DP mai kuch aur videos aayengi ya utni hi hai?
@kumarmanish90462 жыл бұрын
I would love to know about the gear you use to create these videos. Which software and hardware you use?
@2010aishwary4 жыл бұрын
permutations should also contain the swapping of the elements ?
@ishantjha48234 жыл бұрын
Sir agr consecutive permutation only store krwane ho to kya condition lgaege?plz reply asap...
@amarjeetkumarsingh733 Жыл бұрын
Just Amazing....
@parvahuja76185 ай бұрын
thankyou so much bhai
@krishshah51628 ай бұрын
bhaia why do you use return even if it is a void function??
@abhi2245053 жыл бұрын
Javascript Solution bit different than what was explained tho: function permutationWithSpaces(str) { let n = str.length; function helper(initialString, i){ if(i === n){ console.log(initialString); return ; } helper(initialString + str[i], i+1); helper(initialString + "-" + str[i], i+1); } helper("a", 1); } permutationWithSpaces("abcd");
@manishdongarekar92952 жыл бұрын
Code in Java if helped please like import java.util.Scanner; public class Rec_Permutation_with_spaces { public static void main(String[] args) { String str =""; Scanner sc = new Scanner(System.in); str = sc.nextLine(); StringBuilder out = new StringBuilder(); out = out.append(str.charAt(0)); StringBuilder input = new StringBuilder(); input = input.append(str.substring(1,str.length())); recursion(input.toString(),out.toString()); } public static void recursion(String input,String output) { if(input.length()==0) { System.out.println(output); return; } StringBuilder out1 = new StringBuilder(output); StringBuilder out2 = new StringBuilder(output); out1.append(" "); out1.append(input.charAt(0)); out2.append(input.charAt(0)); StringBuilder inputt = new StringBuilder(input); inputt.deleteCharAt(0); recursion(inputt.toString(),out1.toString()); recursion(inputt.toString(),out2.toString()); } }
@dipuprasad91963 жыл бұрын
Thank you very much
@gauranshverma43644 жыл бұрын
headsoff to your input-output method bhai...........love U
@atharvsakhala94693 жыл бұрын
this is a great playlist, thanks a lot! but i think recursion is incomplete without backtracking , so pls make a playlist on that too!