How to calculate time complexity of backtracking algorithm?

In short: Hamiltonian cycle : O(N!) in the worst case WordBreak and StringSegment : O(2^N) NQueens : O(N!) Note: For WordBreak there is an O(N^2) dynamic programming solution. More details: In Hamiltonian cycle, in each recursive call one of the remaining vertices is selected in the worst case. In each recursive call the branch factor decreases by 1. Recursion … Read more