Query in Recursion-All Subsequences

The code is running fine, but the sub sequences are not in lexicographical order .
Question https://hack.codingblocks.com/contests/c/925/73
Code https://ide.codingblocks.com/s/115480
Plz reply.It’s urgent.