Skip to content
Advertisement

knight tour iteration dead end

I am trying to implement knight tour using iteration method. I have already wrote a program using recursion and its working fine, now instead of recursion I am using iteration method with stack to implement knight tour, I have wrote the below code. and here I can not backtrack when I reached to a dead end, could you please check my code and give me some solution.

JavaScript

Advertisement

Answer

JavaScript

This is a toughie. I checked for 5*5 board and 6*6 please check for 7 and 8

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement