Are there any real O(n^n) algorithms?
What you have coded in your example is very similar to a depth first search. So, that’s one answer. A depth first search algorithm without any special characteristics ( like re-convergent paths that can be optimized out ), should be n^n. This is actually not a contrived example. Chess programs operate on the same algorithm. … Read more