• 1 day ago
Transcript
00:00Backtracking is mostly used for three purposes, which is the first one to take a decision.
00:06It means there is a problem for me to find out if there exists any solution for it or not.
00:12Backtracking is the second way to optimize.
00:15I have many solutions to find out the best solution in all of them.
00:20And backtracking is the second way to enumeration.
00:23Enumeration is to list things.
00:26The problem will give me how many possible solutions are.
00:31What can be an example of this?
00:33I have made a grid.
00:36A grid is like a 2D matrix.
00:38In which there are some columns and rows.
00:41This is my grid.
00:43And here I told the game that my starting point is going to be 0.
00:47And my last point is n-1, m-1.
00:52This is my grid.
00:54Now, if I have a question in this grid,
00:56What do I have to do with starting points?
00:58I have to reach the last point from any way to any way to any way to any way.
01:02So, any way exists or not.
01:05So, this is the problem of yes or no,
01:08I will do the decision type of backtracking.
01:10I don't need to remember these terms.
01:12I am just explaining types of problems that we are solving.
01:15The first type of problem will be in which I have to take a decision.
01:19Is this answer yes or no?
01:21If yes will come, what will be possible?
01:24So, what will I do?
01:26I will also print a path in which I will go to the last cell.
01:31The other way of backtracking is optimization.
01:34So, many paths exist in which I will do.
01:38The most shortest path will be.
01:40Or the easiest path will be.
01:43If there will be problems in this way,
01:44then it will be optimization.
01:46The third one is enumeration.
01:48Enumeration is the starting point from last point to the last point.
01:53One path can also be that directly I will go right, right, right and then down.
01:58One path can also be that I will go down and then right.
02:02One path can also be that I am right, down, right, down, right and down.
02:08Depending on the problem,
02:10to solve any problem,
02:11there will be many solutions.
02:13Or we can tell all the solutions
02:16or we can tell that there is a solution possible.
02:19If there is, which solution is?
02:21or not,
02:21then the reason is not clear.
02:23There is not a possible solution.
02:25So, what we are solving usual problems,
02:27they will make one category from these three.
02:29as advantages.
02:30First of all,