Love your videos, but can you please add some more videos on backtracking, Hashing, dp and also Graphs. One of the best channels I have learnt from. Your series on Trees is really great. Covered almost every question in trees!!!
Sure, will try to add more videos on these topics. However in case you haven't seen, we have playlists of DP & Graph problems. Please watch those videos. Thanks.
@@CodingSimplified I watched your tree, graph, linked list, stack, queue playlist, they are awesome, plz make a playlist on competitive programming too
The source you mentioned will not work for the maze below You have to add two more movements one toward left and other towards up {{ 1, 0, 1, 1, 1 }, { 1, 0, 1, 0, 1 }, { 1, 0, 1, 0, 1 }, { 1, 1, 1, 0, 1 } };
In the prog in which part does the back tracking happens?? when down and side both are 0 that particular value is again changed to 0. After that in the code where the back track happens? Please answer.
Hey, backtracking happens when you're going back from same path. In video we've explained where backtracking happening exactly. Please watch it once more & if you find the issue again let us know. Thanks
i am not sure what all are the condition to Rat movement, but a little question check below matrix, there is a path for Rat but code fails... 1 0 1 1 1 0 1 1 1 0 1 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1 1 1 please clarify the Rat movement. or correct me if i am wrong. Code only check for the +1 col and +1 row... What if there is available path for rat to move above row or go to previous column
Another solution to solve this problem:- class Path { int x; int y; public Path(int i, int j) { x = i; y = j; } } public static void ratMazeProblem(int[][] arr) { pathing = new LinkedList(); ratMazeProblem(arr, 0, 0); while (!pathing.isEmpty()) { System.out.print(pathing.removeFirst() + "->"); } } private static void ratMazeProblem(int[][] arr, int i, int j) { if (i >= arr.length || j >= arr[0].length || arr[i][j] == 0 || flag) { return; } if (arr[i][j] == 1) { pathing.add(new Path(i, j)); if (i == arr.length - 1 && j == arr[0].length - 1) { flag = true; return; } } ratMazeProblem(arr, i + 1, j); ratMazeProblem(arr, i, j + 1); if (!flag) pathing.removeLast(); }
Love your videos, but can you please add some more videos on backtracking, Hashing, dp and also Graphs. One of the best channels I have learnt from. Your series on Trees is really great. Covered almost every question in trees!!!
Sure, will try to add more videos on these topics. However in case you haven't seen, we have playlists of DP & Graph problems. Please watch those videos. Thanks.
@@CodingSimplified I watched your tree, graph, linked list, stack, queue playlist, they are awesome, plz make a playlist on competitive programming too
The source you mentioned will not work for the maze below
You have to add two more movements one toward left and other towards up
{{ 1, 0, 1, 1, 1 },
{ 1, 0, 1, 0, 1 },
{ 1, 0, 1, 0, 1 },
{ 1, 1, 1, 0, 1 } };
Thank you so much sir
For simplified explanation.
Well explained. Im from gernany and you helped me with that
Thanks for your nice feedback. Keep watching.
Plz add more problems..keep on uploading more videos ..
Sure, will add more videos on Backtracking in coming days.
Thanks for the video sir. Very good explanation. Can you please suggest on how to print all possible paths.
Sir please make videos on bit algorithms , mathematics and greedy algorithms.
Sure, will try to create videos on these topics. Thanks.
Sir plzz add some videos realted to finding the complexility and how to calculate time complexity
Ok, I'll try to add video on finding Time complexity soon. Thanks for your suggestion.
Coding Simplified thanku so much sir🙏🏻
Is Disjoint set a better approach?
great explanation i've ever watched
Thanks for your nice feedback. Keep Watching.
if we want to print all the possible paths, then?
koi solution hai???
Thanks, It helped!
Thanks for your nice feedback. Keep Watching.
In the prog in which part does the back tracking happens?? when down and side both are 0 that particular value is again changed to 0. After that in the code where the back track happens? Please answer.
Hey, backtracking happens when you're going back from same path. In video we've explained where backtracking happening exactly. Please watch it once more & if you find the issue again let us know. Thanks
Add more backtracking problems
Thanks for your nice feedback. Sure, I'll try to more videos on it.
i am not sure what all are the condition to Rat movement, but a little question
check below matrix, there is a path for Rat but code fails...
1 0 1 1 1 0
1 1 1 0 1 0
0 0 0 0 1 0
0 0 1 1 1 0
0 0 1 0 0 0
0 0 1 1 1 1
please clarify the Rat movement.
or correct me if i am wrong.
Code only check for the +1 col and +1 row... What if there is available path for rat to move above row or go to previous column
the question has two restrictions: rat can move only right or in bottom direction, not left
Another solution to solve this problem:-
class Path {
int x;
int y;
public Path(int i, int j) {
x = i;
y = j;
}
}
public static void ratMazeProblem(int[][] arr) {
pathing = new LinkedList();
ratMazeProblem(arr, 0, 0);
while (!pathing.isEmpty()) {
System.out.print(pathing.removeFirst() + "->");
}
}
private static void ratMazeProblem(int[][] arr, int i, int j) {
if (i >= arr.length || j >= arr[0].length || arr[i][j] == 0 || flag) {
return;
}
if (arr[i][j] == 1) {
pathing.add(new Path(i, j));
if (i == arr.length - 1 && j == arr[0].length - 1) {
flag = true;
return;
}
}
ratMazeProblem(arr, i + 1, j);
ratMazeProblem(arr, i, j + 1);
if (!flag)
pathing.removeLast();
}
Yup, that's is again nice answer. Thanks bro for adding another way of answering.
sir only 3 ?
yeah, I'll add some more to it.
Could you please add more backtracking videos.There are only 3
Sure, will try to add more on it soon. Thanks for your suggestion & interest in channel.
@@CodingSimplified Bro, nearly a year. Please add fews.