Getting all permutations of a word or number

Using LINQ or the old-fashioned approach, how can I get all permutations of a word / number (without using an external API)?

For example, ab = ab, ba, abc = acb, bac, etc.

Is this a specific computer science problem, such as image recognition, etc.?

+4
source share
1 answer

There is a fantastic article on MSDN on this subject that should help you get started. This is a very well-studied computer science problem . For more help, see The Art of Computer Programming Brochures , Volume 4. In particular, see Preface 2B, which accurately covers the problem of generating all permutations.

+5
source

Source: https://habr.com/ru/post/1732196/


All Articles