Answer the question
In order to leave comments, you need to log in
How to iterate over all possible combinations of n objects?
Good afternoon, I'm trying to write a program that would go through all possible combinations of n objects, or more specifically, we have an array containing integers without repetitions. For example, from [1,3,2] and you need to get a list of arrays [1,3,2], [1,2,3], [2,1,3] and so on
, I can’t figure out how to do this, but in the textbooks found only how to calculate the total number of such combinations. Please tell me where you can find similar algorithms and/or their implementations in programming languages
Answer the question
In order to leave comments, you need to log in
their implementation in programming languagesC++, for example (see Possible implementation): next_permutation
Recently answered this question, How to make all unique sequences from a one-dimensional array?
Try looking here www.cyberforum.ru/cpp-beginners/thread676321.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question