Very well explained. N queen question was the foundation stone of this question. The way you sequence all of the question is also very important and you are ace on it.❤️
@Pepcoding3 жыл бұрын
Keep learning and keep loving Pepcoding😊
@snehaashishgupta12543 жыл бұрын
istg am able to register recursion only because of the ordering of recursion questions!
@pallavimeshram54913 жыл бұрын
Finally I can say that I know recursion, Thank you so much for making this videos, I got stucked in recursion in past that's why I was not able to proceed with topics like dp, trees, graphs. But I am feeling confident now.
@AbhishekChaudhary-hl9kx3 жыл бұрын
OMG, done from itself same approach after the dry run and recursion tree. thankyou very very much sir.
@pratyushtiwari1033 жыл бұрын
I was fearing from recursion but after watching your videos i'd say just one thing- maja aagya. Thank you sir for such an awesome playlist
@Pepcoding3 жыл бұрын
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to review us here - g.page/Pepcoding/review?rc
@KejriwalBhakt3 жыл бұрын
Abb yeh maza sabko do..
@ShreyasShirwadkar2 ай бұрын
Sir thank you for this recursion playlist. I was a complete beginner but now I have my basics cleared and can solve diff questions too! THANK YOU 🙏
@priyanshshukla57773 жыл бұрын
Binge watching DSA season 1 (Foundation course ) Thank You Sir
@a_85_viveksinghyadav602 жыл бұрын
Sir today I completed this series and I tried one question of subset using recursion , can't tell you how I feel after solving that by myself. Thanks a lot sir for this amazing series of recursion.
@yelp93594 жыл бұрын
Phli baar itna maza aa raha hai sir recursion padhne me. 🤩🤩
@Pepcoding4 жыл бұрын
Thank you. Please support by subscribing and pressing the bell notification. Also, it will be really helpful to share this in the college groups.
@yelp93594 жыл бұрын
@@Pepcoding already done sir ☺️
@gauravgupta94774 жыл бұрын
Yeah....Now i intentionally write every possible code i could think of recursively. Maza to aa raha hai bhai.
@aashishgoyal14364 жыл бұрын
Thank u so much sir. completed recursion playlist today. Really fantastic videos and explanations.
@Pepcoding4 жыл бұрын
Wow. bhot badhiya. ab aage badhie, DP pe
@aashishgoyal14364 жыл бұрын
@@Pepcoding sure Sir. Thanks a lot for ur guidance
@mayankverma7143 жыл бұрын
Completed the Recursion in Backtracking ; Moving to DP. Thanks to sumeet sir.
@karlmaximum5004 жыл бұрын
Sir thank you for this. You are our savior in these uncertain times. Also when will you upload DSA and interview prep videos on KZbin?
@Pepcoding4 жыл бұрын
Bass next month
@karlmaximum5004 жыл бұрын
@@Pepcoding Thank you so much.
@ShivamSinghMAITCSE4 жыл бұрын
@@Pepcoding sir singh in usa me kitta accha video banwaya sir aapne 😍😍
@potato-gi1xr3 жыл бұрын
thank you so much sir for this Playlist. initially didn't wanted to watch basic recursion videos, since I already knew about them. But, I watched which made my concepts really good and solved the questions on NADOS. Now, I have solved all the questions in DSA level 1- Recursion and backtracking. thank you so much sir.🙏🙏🙏
@democratcobra2 жыл бұрын
Recursion was nightmare to me ...now i am loving it ..thank you Sumit sir...
@amanwadhwa543210 ай бұрын
Now i am also confident about recursion Thanks sir
@bitqahdi65924 жыл бұрын
I enjoyed the entire playlist ! Thanks my best friend
@Pepcoding4 жыл бұрын
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. Keep learning and keep loving Pepcoding☺️
@bitqahdi65923 жыл бұрын
@@Pepcoding Sure Pepcoding is
@swatimaurya94053 жыл бұрын
thank you so much sir itne helpful content ka lea ajj recursion apki vejha se bhut ache se aya ha samjh.😊
@Pepcoding3 жыл бұрын
Glad it helped, for better experience, doubt support, career opportunities and well-organised content, visit - nados.pepcoding.com Don't forget to follow us on Instagram instagram.com/pepcoding/
@AnujRYadav3 жыл бұрын
Completed This Playlist 💗 Feeling Confident Thank You sir
@Pepcoding3 жыл бұрын
Very good, keep it up and always feel confident beta.
@AnujRYadav3 жыл бұрын
@@Pepcoding Thank You So Much Sir
@abhisheksoti11153 жыл бұрын
I express my sincere gratitude towards you Sumeet Sir. I know I could not attend regular classes since I am a 7 year experienced developer in the industry, but still wanted to say Thank you for teaching me so much. I would keep on learning, targeting to finish DSA level 1 this month, Kudos to Nados, great platform.
@Pepcoding3 жыл бұрын
We are really glad that it was helpful for you. Stay tuned on NADOS and on our Instagram account.
@ParasVashishth_RV3 жыл бұрын
Sir, recursion ke liye es playlist ke concepts enough h na, bcz ye vale last 10 ques. khud ban gaye the. plz reply
@Pepcoding3 жыл бұрын
Enough to nh but basic idea de dege ye questions apko recursion ka baki abhi level-2 main bhi cover krege aur questions recursions k
@ParasVashishth_RV3 жыл бұрын
@@Pepcoding ok sir Thanx
@mickyman7533 жыл бұрын
@@Pepcoding sir iske baad seedhe level 2 ka recursion chalu krdu kya ,mujhe basics atey hai dsa ke but sirf recursion aur advance ds main hi problem hai
@raj_kundalia2 жыл бұрын
Watched on 29 December, 2021, thanks for the video.
@ashwinnema062 жыл бұрын
Nice explanation sir. I solved this question myself but I was not getting right answer. Then I saw your code in the video and I found that I missed one condition. Now I solved this question.
@Pepcoding2 жыл бұрын
Great! For better experience and well organised content sign up on nados.io And for being updated follow us on Instagram instagram.com/pepcoding/
@nitinnegi8622 жыл бұрын
Thank you sir for this awesome series!!
@ShivamSinghMAITCSE4 жыл бұрын
sir singh in usa me kitta accha video banwaya sir aapne 😍😍
@Pepcoding4 жыл бұрын
@anshshrivastava91073 жыл бұрын
1:53 laaiye isko hum koshish karne ki koshish krte hain... XD real life recursion
@mickyman7533 жыл бұрын
hands down the playlist to understand recursion
@Pepcoding3 жыл бұрын
Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@codeblooded67603 жыл бұрын
Shouldnt it be chess[0].length for column instead of chess.length ?
@Pepcoding3 жыл бұрын
Beta, both will work because n*n size h
@venkateshkalyan942910 ай бұрын
Sir , why didnt you mention any where in the video that , its a back tracking Algo ? am I missing something ?
@vanshdhiman3664 жыл бұрын
Really great😁 kya samjhate ho sir SIR FLATTENING A LINKED LIST PRR EK VIDEO BANADO, SAMAJ NHI AA RHA
@Pepcoding4 жыл бұрын
Thank you beta. Pkka bnegi video.
@sharuk35453 жыл бұрын
woww you convet the hard problem in the easy problem
@Pepcoding3 жыл бұрын
Thankyou beta! I am glad you liked it. I also hope that you are watching till the end and trying to understand the what, how, and especially why of the problem. If you like our efforts, will you like to review us here - g.page/Pepcoding/review?rc
@harshitkaushik41444 жыл бұрын
Always there for your support sir.
@Pepcoding4 жыл бұрын
Thanks Man😍🙏🏼 Much appreciated😘
@ShivamSinghMAITCSE4 жыл бұрын
Sir please ek aur playlist jisme wo success stories wale baache apna question discuss krte hai unke solution wale video ko us new playlist me add kr dijiye sir " interview previous asked questions "
@Pepcoding4 жыл бұрын
yar, kar to denge. par companies ka non-disclosure agreement hota hai apne staff ke sath. to bache discourage karte hain ajkal. So we will make a list and do a mock interview including those questions.
@pranshulkharniwal81463 жыл бұрын
@@Pepcoding sir list ban gai kya??
@SugamMaheshwari4 жыл бұрын
Sir , Why doesn't it give answer when we don't follow the clockwise pattern of moves ?????
@Pepcoding4 жыл бұрын
beta code wo bhi sahi hoga. Par online judge jo hai wo to text check kar sakta hai. Uske liye ek order lena jaruri tha. Maine clockwise le liya
@ShivamSinghMAITCSE4 жыл бұрын
Bhai aapka answer jo hai wo ek expected answer ke saath seedha seedha check hota hai agar usme ek space ka bhi difference hoga toh wo wrong code bata dega . Its as simple as that pr code wo bhi sahi hai aapka
@prateek21592 жыл бұрын
Sir this solution results in time limit exceeded on naados, gfg and codechef's compilers. Please look into it. And sir you didn't explain warnsdorff's algorithm for this question.
@Pepcoding2 жыл бұрын
Thankyou for the feedback. will look into it and for better experience and well curated content visit nados.io
@nknidhi3213 жыл бұрын
Thank you so much..🔥🔥
@vikasjoshi72363 жыл бұрын
sir ye video graph ki playlist m kyu h ?
@AryanSharma-dh4fb2 жыл бұрын
warnsdorff's algorithm ki wajah se shadad, but you will have to google that algorith.
@vivekkumar-ct7rb3 жыл бұрын
Sir please reply karna, Pehle time complexity karoo ya dp and greedy kyuki pepcoding ke site jab click karta hu to donno har baar change ho jataaa hai, matlab kabhi time complexity ooper aata hai to kabhi DP.
@tusharchamp4883 жыл бұрын
Sir SOlution Submit nahi ho rha ye wala IDE par kya kre...???
@vrindasharma40352 жыл бұрын
Finally, completed the recursion...... So, happyyyyyyyyyyyyy!!!!!!!!
@kashba2 жыл бұрын
abhi kitna karliya aapne?
@jyotiprasadchatterjee87073 жыл бұрын
can i learn these from pep code from class 10? im intersted a lot in computer
@himanshuchhikara49184 жыл бұрын
thankyou sir for making videos like this
@Pepcoding4 жыл бұрын
Thank you very much!! share as much as you can
@sairajdas66923 жыл бұрын
Sir I think we should also check if (chess[r][c] != 0) after first if. May be that's why it is not accepting for some test cases.
@deepakagrawal76872 жыл бұрын
it will not enter into block where displayboard is called for 5*5 matrix. please tell the input for which it will enter the if condition. also please tell why for 5*5 or your input as well blank is output
@HarshKumar-nh6be4 жыл бұрын
Great teaching❤
@Pepcoding4 жыл бұрын
Glad it was helpful!
@035asadali82 жыл бұрын
i just realise i complete the playlist and learn all basics of recursion and backtracking in playlist
@csgirl68953 жыл бұрын
clean and easy code. Thank you so much sir
@Pepcoding3 жыл бұрын
Glad it helped
@navaneethakrishnak93843 жыл бұрын
hello sir actually here the order of writinf recusrsion function maters but why?like if we write 30th line on 31 and 31st on 30 we are getting error
@ManishTiwari-ge1wc4 жыл бұрын
Great Explanation
@Pepcoding4 жыл бұрын
Thankyou beta, I am glad you liked it. I also hope that you are watching till end. If you like our efforts, will you like to write a few words about us here - (www.quora.com/Which-is-the-best-institute-for-coding-in-Delhi)
@harshitkaushik41444 жыл бұрын
manneeessshhhh bhaiiiiii
@sriramkrishnamurthy44733 жыл бұрын
Bhai from which video is backtracking actually started in this playlist apart from level 2 level 1 ke playlist me kaunse video se backtracking start hota hai ?
@NituPandelPCECS Жыл бұрын
Thank you So much🙇
@peeyushpachaori46264 жыл бұрын
Thanks for putting it through, it's great to watch and learn :). For the Knights tour problem, it seems an extension of the Hamiltonian problem, however, I noticed that the code doesn't check for already visited cells. Is it something not required for this?
@Pepcoding4 жыл бұрын
Yes, it is hamiltonian only. Visited nahi chaie kyunki chess board mei he daal dia value, jisse pta chal jata hai ki cell visited hai. If you like my efforts, I request a review g.page/Pepcoding/review?rc
@rahulranjan75674 жыл бұрын
Visited check ho rahi hai base case mein...chess[i][j]>0 hogi to return ho rahi that means we are not going urther down the call. agar hum yeh check nahi karenge toh vauge values aayenge in cells
@AmanKumar-jt9zb3 жыл бұрын
Thankyou so much for your solution videos sir i have missed the actual line of this code that leads to backtracking and it lies in the base case i was setting the last position but while returning i was not setting it to 0 again just in the base case and because of that i was getting wrong answer but now i know what mistake i have dont just because of your solution video. Thankyou again.
@Pepcoding3 жыл бұрын
Glad to know that you liked the content and thank you for appreciating. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos. So, keep motivating, keep learning and keep loving Pepcoding😊
@dheerajkhushalani26193 жыл бұрын
can i display on moves greater than 25 condition.. it can be more easy to understand?? if move >25{ display(chess) return; }
@letsdoeverythinginoneweek93983 жыл бұрын
sir jaise ki hamna display kardiya apna board ko toh usa hatana jaruri ha kya matlab display toh kar diya hamna apna output
@parthsaraswat97444 жыл бұрын
Sir yaha recursion ke basics complete hue hai..backtracking ke thode level question ki videos dekhe ya fir DP par aa jae
@abhinavkohli4293 Жыл бұрын
pecoding's online judge is not working
@nivealokhande2153 Жыл бұрын
bnd kr dia hai 😢
@sakshiaggarwal61993 жыл бұрын
Thank You so much sir!!
@hemantsingh-zo3iw4 жыл бұрын
Sir, you are awesome
@Pepcoding4 жыл бұрын
So nice of you
@nikhilkumarjamwal53222 жыл бұрын
Good one.👍 I did not get that last part of else if condition. Can someone tell me why did we use that condition and how our knight came to last position of table???
@kashba2 жыл бұрын
n queens aur flood fill dekho questions pehle ye smajh aajayega
@loserfruit96633 жыл бұрын
Feel aa gayi sirr
@neerajyadav94124 жыл бұрын
sir ab DP kre yaa Time and Space complexity
@K_EC_piyushkumarsingh2 жыл бұрын
Is it necessary to make chess[][]=0 in base case.?
@Pepcoding2 жыл бұрын
For better insight, visit nados.io, post your doubts, community will help you out there.
@loserfruit96633 жыл бұрын
Dhanyawad
@sahilgupta93783 жыл бұрын
whats the time complexity????
@Pepcoding3 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@sahilgupta93783 жыл бұрын
@@Pepcoding thanks sir, for sure:)
@sahilgupta93783 жыл бұрын
@@Pepcoding Thankyou sir, I posted in telegram and in a minute someone helped, great community
@ritikshrivastava94423 жыл бұрын
what is the time complexity of this man?
@dark_techyy3 жыл бұрын
Ye undo.wali bat smj me ni ayi...hme ek bar visit kiye hue cell ko Dobara visit nhi krna h na...to unvisit q krre h last me?🤔🤔🤔
@jigarlove21133 жыл бұрын
because hme sare answers chahiye n. jitna bhi possible ho sakta hai
@divyanshbarar38402 жыл бұрын
again best ..................... :,*
@rishabhgoyal28354 жыл бұрын
this is showing in graphs of level 1 , plz update it
@Pepcoding4 жыл бұрын
Ok ji.
@taruvarmittal14843 жыл бұрын
sir, aapne move reset kyu kiya ? I mean saari calls ke baad chess[row][column] = 0 kyu kardiya vaapis ?
@Pepcoding3 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@taruvarmittal14843 жыл бұрын
@@Pepcoding ok thankyou sir
@Otmar_Schloetterlein3 жыл бұрын
i have found this way and the best we can go from field 64 to field 1 so are this a solution for all fields
sir gfg aur leetcode kaise use kaRe aapki videos k saath-2
@kiyotaka7214 жыл бұрын
sir is there any way instead of writing 8 recursive call we write the call in a for loop?
@Pepcoding4 жыл бұрын
this is more convenient. yes there is a way. using two d arrays.
@kiyotaka7214 жыл бұрын
@@Pepcoding ok sir and thank u for this amazing content
@rahulranjan75674 жыл бұрын
Gruji is there a position on chess board jisse knights travel krr le puri board ko? I want to see the output for a successful case.Thanks guruji
@Pepcoding4 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@sudhindrashenoy79923 жыл бұрын
Hello Sir.. I kindly request you to create videos on sliding window and two pointers coding patterns
@Pepcoding3 жыл бұрын
Hanji beta, ek bari jo agenda main questions h vo complete kr le, then ye sb cheeze bhi cover kr lenge
@harshpandey76054 жыл бұрын
Sir chess length*chesslength ke liye alg se conition kyun likhi hai please bata dijiye
@Pepcoding4 жыл бұрын
u have to fill the board with each move of the knight and in order to stop the recursion we should know how many total boxes are to filled so as total number of boxes in 2-d matrix is defined as n*m so base case would be applied on that chess length*chess length
@harshpandey76054 жыл бұрын
@@Pepcoding Thank you very much
@vaibhavagarwal9055 Жыл бұрын
solution is wrong. not working
@arijitgoswami75703 жыл бұрын
Sir sare move chalne ke bad chess[r][c]=0 kyu krre ho wo samajh me nhi aya..
@Pepcoding3 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@rohitmeena17723 жыл бұрын
bhai saare moves ko level 1 maan, isme apne backtrack karte hue humne saare options explore kar liye hai isliye ab wapas initial value set karna padega na. Ek baar dry run karke dekho paper me.
@venkateshvenky28804 жыл бұрын
Thanks sir...♥️
@Pepcoding4 жыл бұрын
Most welcome
@arshadmanxoori073 жыл бұрын
Sir Recursion ke baad.. DP karuu ya Basic DS?
@yashodeepdhas84083 жыл бұрын
Same doubt bhai
@arshadmanxoori073 жыл бұрын
@@yashodeepdhas8408 vroo i think DP krna hi sahi rhega
@nivealokhande2153 Жыл бұрын
@@arshadmanxoori07 bhai basic phle krna hota hai, fir recursion, fir dp
@arshadmanxoori07 Жыл бұрын
@@nivealokhande2153 2 saal ho gye bhai.. ab to sb kr liya
@nivealokhande2153 Жыл бұрын
@@arshadmanxoori07 shi hai😂, mai hi late aaya idhr lgta hai
@SCRIPTSAG4 жыл бұрын
Sir aapke sare question samgh aa ja rhe hai but sir aap standard formate me return ker diya kre values ko en Sare problma beacuse on geeks of geeks and leetcode we faced many problems
@Pepcoding4 жыл бұрын
ok ji
@AshishGusain173 жыл бұрын
thanks
@Pepcoding3 жыл бұрын
Glad to know, that you love the explanation, for better experience and precisely arranged videos. Visit - nados.pepcoding.com and sign up to NADOS. Don't forget to follow us on Instagram instagram.com/pepcoding/
@JohnWick-kh7ow3 жыл бұрын
Sir aise video ab kyo nhi banate. ab adhe ghante ke video hote h maja nhi aata. Videos short banaya karo achha response milega.
@whynesspower2 жыл бұрын
3:54 "Tu mujhe marwayegi" ended up being true, faced the same question in microsoft interview HAHAHA
@nknidhi3213 жыл бұрын
🔥❤️
@dayamalik60254 жыл бұрын
Hello chachu your Aryan
@Pepcoding4 жыл бұрын
i love you aryan
@sasikalaramesh8751 Жыл бұрын
please explain in english..:(
@anjneykumarsingh44614 жыл бұрын
Isko dry krne m mja ayega
@Pepcoding4 жыл бұрын
Padhte rahie
@anjneykumarsingh44614 жыл бұрын
Ji guruji
@pratikjha27423 жыл бұрын
knight is ghoda
@Pepcoding3 жыл бұрын
Thank you so much and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@nivealokhande2153 Жыл бұрын
@@abacas2175 😂😂
@smitjoshi45133 жыл бұрын
Can anyone tell me what's wrong in the following code, as I am getting a blank output. import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int[][] chess = new int[n][n]; int row = scn.nextInt(); int col = scn.nextInt(); printKnightsTour(chess,row,col,0); } public static void printKnightsTour(int[][] chess, int row, int col, int upcomingMove) { if(row=chess.length||chess[row][col] >0){ return; } if(upcomingMove == chess.length * chess.length){ chess[row][col] = upcomingMove; displayBoard(chess); chess[row][col] = 0; return; } chess[row][col] = upcomingMove; printKnightsTour(chess,row-2,col+1,upcomingMove+1); printKnightsTour(chess,row-1,col+2,upcomingMove+1); printKnightsTour(chess,row+1,col+2,upcomingMove+1); printKnightsTour(chess,row+2,col+1,upcomingMove+1); printKnightsTour(chess,row+2,col-1,upcomingMove+1); printKnightsTour(chess,row+1,col-2,upcomingMove+1); printKnightsTour(chess,row-1,col-2,upcomingMove+1); printKnightsTour(chess,row-2,col-1,upcomingMove+1); chess[row][col] = 0; } public static void displayBoard(int[][] chess){ for(int i = 0; i < chess.length; i++){ for(int j = 0; j < chess[0].length; j++){ System.out.print(chess[i][j] + " "); } System.out.println(); } System.out.println(); } }
@hodex57633 жыл бұрын
in the main function when you call printKnightsTour you have to pass the move as 1, since you are passing 0 there all the moves in the matrix even when visited by the knight get decremented by one so it never reaches the bas case where it has to execute the displayBoard function. So your code doesn't print anything, if you want to stick to your code in the base case you can write, if(upcomingMove + 1 == chess.length * chess.length)