Permutations without backtracking
Do you need to store all the permutations, or just print them?
How much faster do you expect to get? For any solution to this problem, you're going through n! strings with n characters each at the minimum.
@eugene : Well I need to print them.Oh then you want to say that there is no such solution with time complexity less than what the backtracking problem gives.
working java code here
- antipotato October 16, 2013solvekarlo.com/index.php?subj=2&page=28