Recursion Dictionary Order(Larger)

i am getting wrong answers .
see my code . i think i am not getting question correctly …plzz explain also along with my code …

Check output generated for bdca… it is not sorted.
It is given that the output must be in sorted order. You code will generate the correct permutations but it is not guaranteed that your output will be sorted. For that…instead of printing in base case…you must push it in a vector.You should then sort the resulting vector in the main before printing the final result.

In your code you were sorting it before the function call.