GeeksforGeeks » C/C++ Programming Questions
Finding all possible substring of a given string,sorted in lexicographical order
(2 posts)-
You have given a string. WAP to find all substrings sorted in lexicographical order in efficient way
-
1) Scan the string and store all different different characters in an array. Let the array be ch[].
2) Sort the array ch[].
3) For every character c from left to right in sorted ch[].
.......a) Search for the character c in input string and print all substrings starting from c.
Reply
You must log in to post.