Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Pinterest
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Find All the Well Ordered Permutations of a Given String.

Objec­tive: Write an algo­rithm to Print All the Well Ordered Per­mu­ta­tions of a Given String.

What is Well Ordered String: When all the alpha­bets in a string occur in the increas­ing order irre­spec­tive of Lower Case or Upper case.

This is yet another prob­lem in which you we see the power of recursion.

http://www.careercup.com/question?id=6206517812396032

Exam­ple :

"Sumit" - Not Well Ordered . 'u' occurred after 'S'.

"Now" - Well Ordered. N<o<W.

Approach:

Code:


Out­put:

Given String - Interview
[e, e, I, i, n, r, t, v, w]
[e, e, i, I, n, r, t, v, w]
[e, e, i, I, n, r, t, v, w]
[e, e, I, i, n, r, t, v, w]

You may also like...