sir what is the time complexicity of n queen problem
Time complexicity of n queen
but from internet some post say it is n factorial
Ohh yes my mistake it is factorial
number of possible arrangements of N Queens on N x N chessboard is ๐!, given you are skipping row or column, already having a queen placed.
So average and worst case complexity of the solution is ๐(๐!) (since, you are checking all the possible solutions i.e. ๐๐arrangements). The best case occurs if you find your solution before exploiting all possible arrangements. This depends on your implementation.
And if you need all the possible solutions, the best, average and worst case complexity remains ๐(๐!)
I hope Iโve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.