Lexicographically Bigger String

The following piece of code accepts as input a single string of characters and produces on standard output a string which would be the next string to appear in lexicographical order. Definition of Lexicographical order : wiki (Also known as The Dictionary order since lexicographical order is one in which the strings would appear in ...