Backtracking is one of the genral computer science algorithm to find a solution by try and error. I was not sure this can be called if this is algorithm.
At the beginning, I misunderstood this is the same as a brute-force approach. However, there is a difference between them. Brute force is literally trying ALL possible combination across options. On the other hand, Backtracking is to try, change the variable when it does not work, and then continue till when it finds the solution.
For example, if I have a set of door keys and need to find a toy in my friends' house. However I am standing in front of 4 houses on a street, which my friend located by the pin on google map. I am not sure which house is my friends'. In this case, I need to first try a different key to open the house door. We can try one house door by inserting all keys till I find the house. However, once I found the house, I do not have to try other rooms in the other house which is not my friend's house.
Another example is Sudoku. When we try to solve Sudoku, we use backtracking algorithm.
Word of the day: impetus (a driving force, impulse)