Brahmaji bole "coding kar lo , placement aa raha hai". You are the best teacher. The way you explain the complex concepts in simple manner, it is really amazing. Thanks a lot.
Haha, even if I am unable to reply to every comment on the channel. I make sure to read each and everyone of them !! So don't worry brother, your blessings and comments are reaching out to me. ❤️
Thank you very much for this video as you are the only one who explained why disk needs to move from source to helper first instead of making statement that it has to be moved. Thanks again for focussing on explaining the logic instead of memorize something.
From a long time I couldn't able to understand this problem but I got confidence to solve problems similar like this... really improved my way of thinking of recursion
Aditya... Man you have a great knack of storytelling and that's the reason why you teach so very well. Loved the story... Never have heard it before and the way you narrated it seriously I laughed for like whole of that story time 😂. Thanks a lot.
The best part about the video was the Bhrama story. I loved it. What an amazing story. I heard a story about where a Peasent goes to a King for some rice. So the King asks how much rice does he needs. The Peasent says he needs a single grain of rice for each square in a chess board. The only condition is that you have to double the rice of grain each time you go to a new square. The King was a fool so he agreed to the deal. 2^64 grain of rice is quite much. How much? Well as a proud/weird nerd I went to the internet to find the answer. As it turns out 2^64 grain of rice is roughly equivalent to a millennium(1000 years) of our entire plantes rice production. Yikes!!
this was never so easy to understand aditya bhaiya, you really meant it when you said you would convert us into jedis of recursion, thankyou for doing what you're doing!! :D
And then he said "to priest logo ne bola, "yaar ye thoda zyada ho rha hai par chalo okay"" Couldn't help laughing xDD Your content is so easy to understand :")
Grate i don't have word to thank you Bro!! mene bhot sare videos dekhe par kisise bhi smj nai aaya even gate ki preparation m bhi sir ne pdaya lekin smj nai aaya but because of you I understood it very clearly !! thank you so much
might be this story is correct but I am known to the fact that there is only one temple for brahma dev in entire world, and these has many reasons that are there in hindu mythlogy, one is he was cursed to have just one temple, and that is in pushkar, but the explanation was fabulous sir, no one can make it much easier
yar mera time to logo ke funny comments padhne me chala jata h 🤣🤣🤣🤣, bhai ka to logic works like magic , ek bar me hit kar jata h mind me , bas yahi soch reha hu bramha ji kis comapany me honge aur unka package kya hoga abhi 🤣
bhramaji bole placement aa raha hai coding karo... bhramaji jaisa bole vaisa hai karne ka :) great content... ab kabhi nahi bhuluga iska solution hahahah
Solve the following puzzle for Tower of Hanoi · If puzzle can be accomplished in 3 moves with two discs. Use this to work out how many moves would be needed with three discs? · If puzzle can be completed in 15 moves with four discs. Use this to work out how many moves would be needed with five discs? · In general, describe a way of working out how many moves are needed when one extra disc is added? ye kese hoga
I have a question , this was a little complex solution that had too many variables to track for dry running this code on paper but that didn't matter because of recursion and we solved it easily if we come across a rec code of similar type and had understand it without compiling it can we do it like we solved it (from n to n-1 i mean ) will that be ok
At 10:19 For smaller input why can't we pop the top of the stack and then remaining n-1 ele par solve func lagaye and the hypothesis can be moving all n-1 from source to destination and then in the induction step we push the poped element at pole 3. Can someone clear what's wrong with this approach?
it cannot be done bcoz when u pop it means u are storing it in any of the one pillar(either helper and destination) and then it cannot be solved for remaining disc by only using one pillar bcoz in the pillar storing the top disc u can't put any other disc as it it is of the least size.
18:29 previously when you pass the first argument as n, then how are you receiving with int s which has been given for starting point and n is for no. of plates.
Exact same code in Java: import java.util.*; class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int s = 1, d = 2, h = 3; solve(n , s, d, h); } public static void solve(int n, int s, int d, int h){ if(n == 1){ System.out.println("Moving plate " + n + " from " + s + " to " + d); return; } solve(n - 1, s, h, d); System.out.println("Moving plate " + n + " from " + s + " to " + d); solve(n - 1, h, d, s); } }
Can't we pop the source stack and push to helper stack(it will be reversed).Then pop the helper stack and push to destination(reversed->reversed: original)?
where did you learn this from because never seen such an explanation like this bro plz tell this bro !! you are amazing liked and subscribed and make a video on books and online material for the best understanding of ds and algo as you used !!!!!!
haha I didnt learn this from anywhere, as the time passed I started to make my own methods and started to see patterns that were never mentioned anywhere before. You will too, just keep practising.
#include using namespace std; void toh(char s, char d, char a, int n) { if (n == 0) return; toh(s, a, d, n - 1); // move the n-1 discs from source to aux using destination rod cout
that moment ki brahma ji bhi coding krte the or humko bhi coding krni chahiye was lit XD bro i m damn sure u had taken coaching from kota....Your teaching method is same as kota it faculties plz reply if u had ever study in kota
one classic misconception i faced was that while taking the help of helper, even then i have to stay mindful of the condition that its always smaller above the widder one. thus i was overthinking on it. xD
sir, induction step main ap cout kar rahe hian moving plate n from A to C. jabki humein pata hain ki ek hi plate bacha hua hain. yeh n plate ka funda samajh nhi aya, pata hain n likh rahe hain tab hi 1, 2, 3 karke print hoga, but apke tarika se wo kaise malum kare ki n likhna hain waha. Baki sab cystral clear hain bas ek yehi hain
Bhai u will revolutionize the teaching standards on youtube!!!. Well for me, i think you have already done it. Hats off bro.
Brahmaji bole "coding kar lo , placement aa raha hai". You are the best teacher. The way you explain the complex concepts in simple manner, it is really amazing. Thanks a lot.
Mark the words ...one of the best playlist available for recursion!!!! :)
Priest logo n bolo thoda zyada hora h but its ok 😆😆😆
Great content as usual 👍
😅😅 Thanks !!
😂😂
😂🤣🤣🤣
Yeah sahi tha!
How casually bhaiya said this 😅😅😅
Every time I do a recursion problem:
My Time Complexity: " Thoda jyada ho rha hai par thik hai"
th-cam.com/video/VC4V67q2kEk/w-d-xo.html
Others: Tower of hanoi.
Aditya verma: Tower of brahma.😂
Thank you sir for making this playlist.
I hope, further we will get more content. 🙏
Dark
Never came across such a unique way of teaching things. Thanks for such a great content .
Brahmaji ki Jay :)
bhai how u r teaching in unique manner i think u were blessed with it
Thanks brother, just developed my own way of learning things !! 😅
I watched ur every video but today i felt like if i comment today u'll reply me Finally it Happened 😍
Haha, even if I am unable to reply to every comment on the channel. I make sure to read each and everyone of them !! So don't worry brother, your blessings and comments are reaching out to me. ❤️
@@TheAdityaVerma sahi h ❤️
Recursion is seriously magic!! And the way you explain it is so amazing !
but im getting demotivated .. not able to solve any questions from past 25 days
@@googlepay4295 Don't play PUBG
@@asishcodes seriously bro ....its jus name 🤣🤣🤣
My younger did this
Thank you very much for this video as you are the only one who explained why disk needs to move from source to helper first instead of making statement that it has to be moved. Thanks again for focussing on explaining the logic instead of memorize something.
The most hilarious line for me was, brahma ji ne bola, 'choti plate ke upar badi plate mat rakh dena bohot pitoge' XD. You make this too fun bhai
From a long time I couldn't able to understand this problem but I got confidence to solve problems similar like this...
really improved my way of thinking of recursion
sir u r great.
GFG waalo ne dimag ka dahi kar diya thaa aapne achcha sikhaya.🤩🤩
Wow, TBH now i am getting a great confidence in this recursion... really great playlist
6:40 bahut pitogee... 😂😂
bhramaji rocked..!
😅 Bhramaji's Thug Life
😂🤣
Your teaching style is just amazing.
Please keep uploading this type of amazing content.
Aditya... Man you have a great knack of storytelling and that's the reason why you teach so very well. Loved the story... Never have heard it before and the way you narrated it seriously I laughed for like whole of that story time 😂. Thanks a lot.
Pahali baar kisi ne TOH itne unique aur easy way me samjhaya..
Thanks Aditya bhaiya.. (Aap hamare liye Bramhaji ke Priest ho)
video bnana khtm kr doge to universe waps restart ho jaegi
Bhaiya aap same Love Babbar ki tarah samjhate ho....dono hi ek dam OP ho...concept crystal clear ho jate h🙌
The best part about the video was the Bhrama story. I loved it. What an amazing story. I heard a story about where a Peasent goes to a King for some rice. So the King asks how much rice does he needs. The Peasent says he needs a single grain of rice for each square in a chess board. The only condition is that you have to double the rice of grain each time you go to a new square. The King was a fool so he agreed to the deal. 2^64 grain of rice is quite much. How much? Well as a proud/weird nerd I went to the internet to find the answer. As it turns out 2^64 grain of rice is roughly equivalent to a millennium(1000 years) of our entire plantes rice production. Yikes!!
TOB was never this easy bro. Hats off
DSA padhane ka tarika thoda casual hai
someone recomended this channel to me.....great content
this was never so easy to understand aditya bhaiya, you really meant it when you said you would convert us into jedis of recursion, thankyou for doing what you're doing!! :D
And then he said "to priest logo ne bola, "yaar ye thoda zyada ho rha hai par chalo okay"" Couldn't help laughing xDD Your content is so easy to understand :")
Just Checked out your channel!! Hope you become a better coder and TH-camr than aditya!✌️
Haha, maybe in another world, thanks for checking out! Means a lot :)
code padhne m aur samjane m fark hota hai ,this is is teching how to write code,@Aditya bhiya love u
Grate i don't have word to thank you Bro!! mene bhot sare videos dekhe par kisise bhi smj nai aaya even gate ki preparation m bhi sir ne pdaya lekin smj nai aaya but because of you I understood it very clearly !! thank you so much
Sir mene bhot sare videos dekhe tower of hanoi k lekin mujhe samajh nhi aa rha tha .
apka video dekh k mujhe ache se samajh aa gaya .thank you sir
Brahma ji v coding karte the , toh chalo hamlog v karte h.
hamlog toh Aditya bhai aapkji wajah se kar paa rhe h
Thanks bro..
This is some next level way of teaching !!!
great job bro!!! you've very unique and great way of teaching things!! you made such complex things so easy !! I appreciate it bro !!
Was stuck at this problem from so long . Great explanation . Thank you for these ❤️
Brahmaji bhi coding kerte the😂😂
😅😅
Brahmaji ki Jay 🙏🙏❤️
Aur hum bhi karenge☺️☺️☺️
he created universe(brahmaand) so yes.
yeah, that was good.
Nyccc bro mene abhi bahut jagah se samjha iska code but meko yaha se clear ho gaya thanku bhaai 🤗
Today I understood the term "Recursion works like magic"
Bahut Behtarinnnn.... tarike se samjh Aa gya , Aaditya BHai
👍👍😎😎
->> KOi gold medal do Inko 😆
might be this story is correct but I am known to the fact that there is only one temple for brahma dev in entire world, and these has many reasons that are there in hindu mythlogy, one is he was cursed to have just one temple, and that is in pushkar, but the explanation was fabulous sir, no one can make it much easier
Thank you bhai especially for the Amazing story...
Great visualization in explaining this.
Visualization will help retain the problem. Thanks.
you've made life easier for me
this is pure gold content, thanks a lot bhaiya 😊
one of the best technique......Best mentor🤩🤩🤩🤩🤩🤩
Sir Again You explained it in a Really Great manner , love your Channel , Please please Upload Graphs Too
This is the best video on Towers of Hanoi.
Well I must say anyway good teacher is a great story teller. Look at you!!
"zyada ho rha hai par kar lenge" was 😅😂 Amazing lecture
for count we can directly print that using maths i.e.
n disks can be solved in minimum 2^n−1 steps.
What a explanation 🔥
Hats off ♥
Thanks a lot I'll never have to memorize the TOH code ever again!
#storytelling awesome bhaiya 😍😍
Brahmaji apne aditya bhai ko ye task dete, ek program me khel khtm, 😅😅
.Achcha hai nhi diya wrna sab chutkiyo me finish
c++ solution:-
long long count=0;
long long toh(int N, int from, int to, int aux) {
count++;
if(N==1) {
cout
thanks a lot mere bhai for the explanation of the code because i was confused how its code work but now you have cleared all my doubts :-)
yar mera time to logo ke funny comments padhne me chala jata h 🤣🤣🤣🤣, bhai ka to logic works like magic , ek bar me hit kar jata h mind me , bas yahi soch reha hu bramha ji kis comapany me honge aur unka package kya hoga abhi 🤣
You are the best teacher
Real power of recursion!!!!!!!!!💪💪💪💪
Now some people will call you Sanghi Aditya Verma😂😂😂 btw great teaching man.
bhramaji bole placement aa raha hai coding karo... bhramaji jaisa bole vaisa hai karne ka :)
great content... ab kabhi nahi bhuluga iska solution hahahah
amazing teaching way of yours thank you.
your channel is brahmastra!!
Wah I loved the introduction
Solve the following puzzle for Tower of Hanoi
· If puzzle can be accomplished in 3 moves with two discs. Use this to work out how many moves would be needed with three discs?
· If puzzle can be completed in 15 moves with four discs. Use this to work out how many moves would be needed with five discs?
· In general, describe a way of working out how many moves are needed when one extra disc is added?
ye kese hoga
2^n - 1; where n == number of discs
Pdf notes ke liye 3$ Pocket me ready rakhein!! Dhanyavad
Great way of teaching, keep going brother !!!
Great video 👍👍
har question ka time complexity bhi explain kariye, please :)
baki, videos are wonderful!
me - which compiler do you use ??
brahma ji - priest
I have a question ,
this was a little complex solution that had too many variables to track for dry running this code on paper but that didn't matter because of recursion and we solved it easily
if we come across a rec code of similar type and had understand it without compiling it can we do it like we solved it (from n to n-1 i mean ) will that be ok
man of culture
The diagram of 'Priest logo' 😂😂
PS : 4:17 , 6:57
😂😂
😂😂
At 10:19 For smaller input why can't we pop the top of the stack and then remaining n-1 ele par solve func lagaye and the hypothesis can be moving all n-1 from source to destination and then in the induction step we push the poped element at pole 3. Can someone clear what's wrong with this approach?
it cannot be done bcoz when u pop it means u are storing it in any of the one pillar(either helper and destination) and then it cannot be solved for remaining disc by only using one pillar bcoz in the pillar storing the top disc u can't put any other disc as it it is of the least size.
I had heard this story from Sharma sir😀😀😀
"Priest logo ne kaha ki thora jayada ho raha hain lekin thik hain" is a lit
22:01 agar number of steps print karane hain to seedhe (2^N - 1) print kara sakte hain. recursion chala ke time complexity kyu badhaye?
interviewer puchega ratta marke aye ho kya😆
18:29 previously when you pass the first argument as n, then how are you receiving with int s which has been given for starting point and n is for no. of plates.
I think the h->d step should have the function call like:
solve(h,s,d,n-1);
bohot zabardast video hai bhai...bas agli bar thoda short rakhna best of luck
void towerOfHanio(int n, char src, char dest, char helper)
{
if (n == 0)
return;
towerOfHanio(n - 1, src, helper, dest);
cout
JODDDD
Exact same code in Java:
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int s = 1, d = 2, h = 3;
solve(n , s, d, h);
}
public static void solve(int n, int s, int d, int h){
if(n == 1){
System.out.println("Moving plate " + n + " from " + s + " to " + d);
return;
}
solve(n - 1, s, h, d);
System.out.println("Moving plate " + n + " from " + s + " to " + d);
solve(n - 1, h, d, s);
}
}
Can't we pop the source stack and push to helper stack(it will be reversed).Then pop the helper stack and push to destination(reversed->reversed: original)?
We can't keep larger discs on smaller discs... If we reverse them, this rule will be violated. So, ....
Outstanding Teaching!
where did you learn this from because never seen such an explanation like this bro plz tell this bro !! you are amazing liked and subscribed and make a video on books and online material for the best understanding of ds and algo as you used !!!!!!
haha I didnt learn this from anywhere, as the time passed I started to make my own methods and started to see patterns that were never mentioned anywhere before. You will too, just keep practising.
@@TheAdityaVerma okay bhaiya thankyou ! keep growig
Nice explanation...
is this algorithm applicable for 4 discs? For the four discs problem we will use source aswell for the transferring the discs.
#include
using namespace std;
void toh(char s, char d, char a, int n)
{
if (n == 0)
return;
toh(s, a, d, n - 1); // move the n-1 discs from source to aux using destination rod
cout
Why I am coding because I love coding? Hell no . "Brahama ji bhi coding krte the isska mtlb humme bhi coding krni chahiye"- Aditya Verma
Thank u bhaiya for such a wonderful explanation
"thoda jayda ho rha hai par chalo ok" was funny
Bhai level h seriously , amazing 💯💯
Brahma Ji b coding krte the...Hamein bhi coding krni chahiye!! 😂😂
Thanks a ton for the explanation!!
that moment ki brahma ji bhi coding krte the or humko bhi coding krni chahiye was lit XD
bro i m damn sure u had taken coaching from kota....Your teaching method is same as kota it faculties
plz reply if u had ever study in kota
wonderful explaination as usual
thank god, universe mara placement ka baad khatum hogi . LOL
university ka 3 teachers samjha nahi paye par aap seh samaj gaya
Looks like at the end of this problem Bhrammaji ka recursive stack memory complete hogi and new system(universe) banayega :) :)
Thank you sooo much sir🥺❤
maza aa gya story sun ke..
another masterpiece, awaz thodi aur tez hoti toh din hi ban jata xD
Have Ordered a new mic, audio quality will improve in future videos.
@@TheAdityaVerma Itni mehnat k baad aaj reply mila... bas utna hi kaafi h bro.. 😂
Sorry bro, I may not able to reply to all the comments, but I read every single of them, so your messages and comment are reaching me 😅❤️ Dont worry ✅
bro, which tools you use for video recording and writing?
he is using some sort of ipad for writing and for recording it must be kine master
Aditya really apricate the good work, could you please improve the audio qualities of the videos.
again bhai love ur content ,priest ko billions of year lgenge,aur humey dekhlo 24 minute m pauncha de plates ko ider se udher.😂😂😂
one classic misconception i faced was that while taking the help of helper, even then i have to stay mindful of the condition that its always smaller above the widder one. thus i was overthinking on it. xD
You have to be mind about that condition even while taking the help of helper.
sir, induction step main ap cout kar rahe hian moving plate n from A to C. jabki humein pata hain ki ek hi plate bacha hua hain. yeh n plate ka funda samajh nhi aya, pata hain n likh rahe hain tab hi 1, 2, 3 karke print hoga, but apke tarika se wo kaise malum kare ki n likhna hain waha. Baki sab cystral clear hain bas ek yehi hain