Why backtracking is not required in this question I am getting correct output without using backtracing
Dictionary Order Larger problem
Someone reply to this why backtracking is not required
Both with backtracking and without backtracking will give the correct permutations but arranged in different order.
Here in this problem you need the order formed just by the recursive way. But note that the parameters passed to recursive function are passed by value (as in string ) and not by reference. If it is passed by reference, you will notice that it will give the wrong permutations. In that case backtracking would be necessary.
Can you please give solution using backtracking because I am getting wrong output when I use it
here you do not have to use backtracking as i have said…you just have to go with simple recursion.
Backtracking will give wrong output(actually the correct permutations but in the order which is not required in this problem) in this case as the test cases are set according to the simple recursive way.
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.