Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string permutations[SIZE];
- bool used[SIZE];
- string v[SIZE];
- void generate_permutations(int x) {
- if (x == SIZE) {
- // esegui operazioni sulla permutazione
- return
- }
- for (int i = 0; i < SIZE; i++) {
- if (used[i]) continue;
- permutations[x] = v[i];
- used[i] = true;
- generate_permutations(x + 1);
- used[i] = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement