I know how to print it in simple order but not in lexicographical order. For lexicographic order i think i need to store all the subsequences first and then sort them but i think for printing return type of function will be void. Can anyone help me out.
I dont know how to print in lexicgraphical order
Hi @mudit2jain,yes you can do it like this. Before printing you just have to sort the arraylist or the array that you have used.
That means this function’s return type will not be void. I was hoping of some other way with void return type to print in sorted order.
Hi yes function return type will not be void.