Hi there,
The algorithm of Phone Number Mnemonic is exhaustive recursion: enumerate each character in the given string num
and recursively append other letters to it. I’m not so sure what is the time complexity of it?
I think for exhaustive recursion, such as N Queens and Power Set, the time complexity is exponential. Same like this one, T(n) = m * T(n - 1) + c, where m is the number of letters and n is the length of the given string. So the time complexity is T(n) = O(m ^ n) . Is it correct?
Thanks a lot.