Subsequences in lexical order

Pls tell how to print all subsequences of a given string in “lexicographical order”.

Hey Ajay ! you can try o solve this in the same manner as you find all subsequences of string but save all the subsequences in a map or any other data structure or an array of string and finally you sort the string array in which you saved all the subsequences .
https://ide.codingblocks.com/#/s/14270
Cool now ??

Thanks abhishek :smiley:

Can you pls explain the working of the code…
tried the dry run for abc … It’s not clear…

How did you take the base case and the recursive one !!
Also what did this line m[temp] = temp; do ?