0
Is "recursion" and "backtracking" the same thing or is backtracking a kind of recursion ?
Backtracking is usually implemented using recursion. How both of them relate to each other ?
2 Antworten
+ 3
Backtracking is a property of an algorithm and recursive function is a way of achieving it ;)
+ 1
Here's a maze solver where we could name things recursion and backtracking:
https://code.sololearn.com/WwI44YsoFHiG/?ref=app
Choose "let the program solve".
Ask:
Recursion: What's special about intersections? What happens there?
How is "what happens" related to the task that was just being done?
Backtracking: What's special about dead ends? What happens there? ...