Compute all the permutations for a given vector of integers Planned maintenance scheduled...
Is there a verb for listening stealthily?
"Working on a knee"
How to keep bees out of canned beverages?
SQL Server placement of master database files vs resource database files
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
`FindRoot [ ]`::jsing: Encountered a singular Jacobian at a point...WHY
TV series episode where humans nuke aliens before decrypting their message that states they come in peace
A journey... into the MIND
Why is arima in R one time step off?
Coin Game with infinite paradox
Bright yellow or light yellow?
Retract an already submitted Recommendation Letter (written for an undergrad student)
Israeli soda type drink
What helicopter has the most rotor blades?
What to do with someone that cheated their way though university and a PhD program?
When does Bran Stark remember Jamie pushing him?
Can gravitational waves pass through a black hole?
Why is water being consumed when my shutoff valve is closed?
Why would the Overseers waste their stock of slaves on the Game?
Why did Israel vote against lifting the American embargo on Cuba?
My admission is revoked after accepting the admission offer
Why aren't road bicycle wheels tiny?
What's called a person who works as someone who puts products on shelves in stores?
Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table
Compute all the permutations for a given vector of integers
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Generating all possible permutations of the stringGenerate all permutationsPrinting all the permutations of a string in alphabetical orderNecklace counting problem-with consecutive prime constraintDisplaying all permutations of a stringGenerating all permutations of a sequenceGet all points within given radius for a given vectorAll permutations of integer vectorMedian of a Vector assignmentGenerate all possible permutations of a string in C++
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
$begingroup$
The task is to compute all the permutations for a given vector of integers (but of course the specific integer type is not relevant for the solution)
The strategy is based on recursion + iterations
At each recursion, the state consists of
the root sequence
a
which is the set of elements already placedthe remaining elements set
b
which is the set of elements still to be placed
Inside the recursion, a loop places the N(i)
(with i
recursion index and) remaining elements producing the same amount of new root sequences and a new recursion is started so that N(i+1)=N(i)-1
hence meaning the overall complexity is O(N!)
as expected
The recursion ends when there are no more elements to place hence b.empty()
is true
Each recursion set ends with a valid sequence hence they are all merged together in a final list of sequences
Here is my CPP solution
#include <iostream>
#include <vector>
using namespace std;
vector<int> remove_item (const vector<int>& a, const unsigned int id)
{
vector<int> res;
for(unsigned int i=0; i<a.size(); ++i) if(i!=id) res.push_back(a[i]);
return res;
}
vector<int> add_item(const vector<int>& a, const int b)
{
vector<int> res=a;
res.push_back(b);
return res;
}
vector< vector<int> > merge(const vector< vector<int> >& a, const vector< vector<int> >& b)
{
vector< vector<int> > res=a;
for(const auto& e : b) res.push_back(e);
return res;
}
vector< vector<int> > permutations(const vector<int>& b, const vector<int>& a={})
{
if(b.empty()) return { a };
vector< vector<int> > res;
for(unsigned int i=0; i<b.size(); ++i) res=merge(res, permutations(remove_item(b,i), add_item(a, b[i])));
return res;
}
int main() {
// your code goes here
auto res = permutations({1,2,3,4,5});
cout << "Sol Num = " << res.size() << endl;
for(const auto& a : res)
{
for(const auto& b : a) cout << to_string(b) << " ";
cout << endl;
}
return 0;
}
c++ reinventing-the-wheel combinatorics
New contributor
$endgroup$
add a comment |
$begingroup$
The task is to compute all the permutations for a given vector of integers (but of course the specific integer type is not relevant for the solution)
The strategy is based on recursion + iterations
At each recursion, the state consists of
the root sequence
a
which is the set of elements already placedthe remaining elements set
b
which is the set of elements still to be placed
Inside the recursion, a loop places the N(i)
(with i
recursion index and) remaining elements producing the same amount of new root sequences and a new recursion is started so that N(i+1)=N(i)-1
hence meaning the overall complexity is O(N!)
as expected
The recursion ends when there are no more elements to place hence b.empty()
is true
Each recursion set ends with a valid sequence hence they are all merged together in a final list of sequences
Here is my CPP solution
#include <iostream>
#include <vector>
using namespace std;
vector<int> remove_item (const vector<int>& a, const unsigned int id)
{
vector<int> res;
for(unsigned int i=0; i<a.size(); ++i) if(i!=id) res.push_back(a[i]);
return res;
}
vector<int> add_item(const vector<int>& a, const int b)
{
vector<int> res=a;
res.push_back(b);
return res;
}
vector< vector<int> > merge(const vector< vector<int> >& a, const vector< vector<int> >& b)
{
vector< vector<int> > res=a;
for(const auto& e : b) res.push_back(e);
return res;
}
vector< vector<int> > permutations(const vector<int>& b, const vector<int>& a={})
{
if(b.empty()) return { a };
vector< vector<int> > res;
for(unsigned int i=0; i<b.size(); ++i) res=merge(res, permutations(remove_item(b,i), add_item(a, b[i])));
return res;
}
int main() {
// your code goes here
auto res = permutations({1,2,3,4,5});
cout << "Sol Num = " << res.size() << endl;
for(const auto& a : res)
{
for(const auto& b : a) cout << to_string(b) << " ";
cout << endl;
}
return 0;
}
c++ reinventing-the-wheel combinatorics
New contributor
$endgroup$
add a comment |
$begingroup$
The task is to compute all the permutations for a given vector of integers (but of course the specific integer type is not relevant for the solution)
The strategy is based on recursion + iterations
At each recursion, the state consists of
the root sequence
a
which is the set of elements already placedthe remaining elements set
b
which is the set of elements still to be placed
Inside the recursion, a loop places the N(i)
(with i
recursion index and) remaining elements producing the same amount of new root sequences and a new recursion is started so that N(i+1)=N(i)-1
hence meaning the overall complexity is O(N!)
as expected
The recursion ends when there are no more elements to place hence b.empty()
is true
Each recursion set ends with a valid sequence hence they are all merged together in a final list of sequences
Here is my CPP solution
#include <iostream>
#include <vector>
using namespace std;
vector<int> remove_item (const vector<int>& a, const unsigned int id)
{
vector<int> res;
for(unsigned int i=0; i<a.size(); ++i) if(i!=id) res.push_back(a[i]);
return res;
}
vector<int> add_item(const vector<int>& a, const int b)
{
vector<int> res=a;
res.push_back(b);
return res;
}
vector< vector<int> > merge(const vector< vector<int> >& a, const vector< vector<int> >& b)
{
vector< vector<int> > res=a;
for(const auto& e : b) res.push_back(e);
return res;
}
vector< vector<int> > permutations(const vector<int>& b, const vector<int>& a={})
{
if(b.empty()) return { a };
vector< vector<int> > res;
for(unsigned int i=0; i<b.size(); ++i) res=merge(res, permutations(remove_item(b,i), add_item(a, b[i])));
return res;
}
int main() {
// your code goes here
auto res = permutations({1,2,3,4,5});
cout << "Sol Num = " << res.size() << endl;
for(const auto& a : res)
{
for(const auto& b : a) cout << to_string(b) << " ";
cout << endl;
}
return 0;
}
c++ reinventing-the-wheel combinatorics
New contributor
$endgroup$
The task is to compute all the permutations for a given vector of integers (but of course the specific integer type is not relevant for the solution)
The strategy is based on recursion + iterations
At each recursion, the state consists of
the root sequence
a
which is the set of elements already placedthe remaining elements set
b
which is the set of elements still to be placed
Inside the recursion, a loop places the N(i)
(with i
recursion index and) remaining elements producing the same amount of new root sequences and a new recursion is started so that N(i+1)=N(i)-1
hence meaning the overall complexity is O(N!)
as expected
The recursion ends when there are no more elements to place hence b.empty()
is true
Each recursion set ends with a valid sequence hence they are all merged together in a final list of sequences
Here is my CPP solution
#include <iostream>
#include <vector>
using namespace std;
vector<int> remove_item (const vector<int>& a, const unsigned int id)
{
vector<int> res;
for(unsigned int i=0; i<a.size(); ++i) if(i!=id) res.push_back(a[i]);
return res;
}
vector<int> add_item(const vector<int>& a, const int b)
{
vector<int> res=a;
res.push_back(b);
return res;
}
vector< vector<int> > merge(const vector< vector<int> >& a, const vector< vector<int> >& b)
{
vector< vector<int> > res=a;
for(const auto& e : b) res.push_back(e);
return res;
}
vector< vector<int> > permutations(const vector<int>& b, const vector<int>& a={})
{
if(b.empty()) return { a };
vector< vector<int> > res;
for(unsigned int i=0; i<b.size(); ++i) res=merge(res, permutations(remove_item(b,i), add_item(a, b[i])));
return res;
}
int main() {
// your code goes here
auto res = permutations({1,2,3,4,5});
cout << "Sol Num = " << res.size() << endl;
for(const auto& a : res)
{
for(const auto& b : a) cout << to_string(b) << " ";
cout << endl;
}
return 0;
}
c++ reinventing-the-wheel combinatorics
c++ reinventing-the-wheel combinatorics
New contributor
New contributor
edited 10 hours ago
Deduplicator
12k1950
12k1950
New contributor
asked 16 hours ago
Nicola BerniniNicola Bernini
1262
1262
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
A cleaner solution is to trust the standard library and try to re-use the generic components already available there. Your problem is solved by std::next_permutation, so you can proceed along the lines of:
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = { 1, 2, 3, 4, 5 };
do
{
for (auto e : v)
std::cout << e << " ";
std::cout << "n";
}
while (std::next_permutation(v.begin(), v.end()));
}
For pedagocical purposes, if you wanted to keep your current structure, you could also use standard functions there. In particular, remove_item
and merge
could be rewritten to:
std::vector<int> remove_item(const std::vector<int>& a, int id)
{
assert(id >= 0 && id < a.size());
std::vector<int> res(a.begin(), a.begin() + id);
res.insert(res.end(), a.begin() + id + 1, a.end());
return res;
}
std::vector<std::vector<int> > merge(const std::vector<std::vector<int> >& a, const std::vector<std::vector<int> >& b)
{
std::vector<std::vector<int> > res(a);
std::copy(b.begin(), b.end(), std::back_inserter(res));
return res;
}
Whatever you do, as general comments:
Avoid writing
using namespace std;
.Don't write
std::endl
whenn
will do.You don't need
std::to_string
, just printb
.
You are more likely to make mistakes when you put multiple statements on the same line. So instead of writing
for(...) if(...) v.push_back(x);
just write
for(...)
{
if(...)
{
v.push_back(x);
}
}
This also improves readability.
$endgroup$
1
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
1
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "196"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Nicola Bernini is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217939%2fcompute-all-the-permutations-for-a-given-vector-of-integers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
A cleaner solution is to trust the standard library and try to re-use the generic components already available there. Your problem is solved by std::next_permutation, so you can proceed along the lines of:
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = { 1, 2, 3, 4, 5 };
do
{
for (auto e : v)
std::cout << e << " ";
std::cout << "n";
}
while (std::next_permutation(v.begin(), v.end()));
}
For pedagocical purposes, if you wanted to keep your current structure, you could also use standard functions there. In particular, remove_item
and merge
could be rewritten to:
std::vector<int> remove_item(const std::vector<int>& a, int id)
{
assert(id >= 0 && id < a.size());
std::vector<int> res(a.begin(), a.begin() + id);
res.insert(res.end(), a.begin() + id + 1, a.end());
return res;
}
std::vector<std::vector<int> > merge(const std::vector<std::vector<int> >& a, const std::vector<std::vector<int> >& b)
{
std::vector<std::vector<int> > res(a);
std::copy(b.begin(), b.end(), std::back_inserter(res));
return res;
}
Whatever you do, as general comments:
Avoid writing
using namespace std;
.Don't write
std::endl
whenn
will do.You don't need
std::to_string
, just printb
.
You are more likely to make mistakes when you put multiple statements on the same line. So instead of writing
for(...) if(...) v.push_back(x);
just write
for(...)
{
if(...)
{
v.push_back(x);
}
}
This also improves readability.
$endgroup$
1
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
1
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
add a comment |
$begingroup$
A cleaner solution is to trust the standard library and try to re-use the generic components already available there. Your problem is solved by std::next_permutation, so you can proceed along the lines of:
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = { 1, 2, 3, 4, 5 };
do
{
for (auto e : v)
std::cout << e << " ";
std::cout << "n";
}
while (std::next_permutation(v.begin(), v.end()));
}
For pedagocical purposes, if you wanted to keep your current structure, you could also use standard functions there. In particular, remove_item
and merge
could be rewritten to:
std::vector<int> remove_item(const std::vector<int>& a, int id)
{
assert(id >= 0 && id < a.size());
std::vector<int> res(a.begin(), a.begin() + id);
res.insert(res.end(), a.begin() + id + 1, a.end());
return res;
}
std::vector<std::vector<int> > merge(const std::vector<std::vector<int> >& a, const std::vector<std::vector<int> >& b)
{
std::vector<std::vector<int> > res(a);
std::copy(b.begin(), b.end(), std::back_inserter(res));
return res;
}
Whatever you do, as general comments:
Avoid writing
using namespace std;
.Don't write
std::endl
whenn
will do.You don't need
std::to_string
, just printb
.
You are more likely to make mistakes when you put multiple statements on the same line. So instead of writing
for(...) if(...) v.push_back(x);
just write
for(...)
{
if(...)
{
v.push_back(x);
}
}
This also improves readability.
$endgroup$
1
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
1
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
add a comment |
$begingroup$
A cleaner solution is to trust the standard library and try to re-use the generic components already available there. Your problem is solved by std::next_permutation, so you can proceed along the lines of:
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = { 1, 2, 3, 4, 5 };
do
{
for (auto e : v)
std::cout << e << " ";
std::cout << "n";
}
while (std::next_permutation(v.begin(), v.end()));
}
For pedagocical purposes, if you wanted to keep your current structure, you could also use standard functions there. In particular, remove_item
and merge
could be rewritten to:
std::vector<int> remove_item(const std::vector<int>& a, int id)
{
assert(id >= 0 && id < a.size());
std::vector<int> res(a.begin(), a.begin() + id);
res.insert(res.end(), a.begin() + id + 1, a.end());
return res;
}
std::vector<std::vector<int> > merge(const std::vector<std::vector<int> >& a, const std::vector<std::vector<int> >& b)
{
std::vector<std::vector<int> > res(a);
std::copy(b.begin(), b.end(), std::back_inserter(res));
return res;
}
Whatever you do, as general comments:
Avoid writing
using namespace std;
.Don't write
std::endl
whenn
will do.You don't need
std::to_string
, just printb
.
You are more likely to make mistakes when you put multiple statements on the same line. So instead of writing
for(...) if(...) v.push_back(x);
just write
for(...)
{
if(...)
{
v.push_back(x);
}
}
This also improves readability.
$endgroup$
A cleaner solution is to trust the standard library and try to re-use the generic components already available there. Your problem is solved by std::next_permutation, so you can proceed along the lines of:
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = { 1, 2, 3, 4, 5 };
do
{
for (auto e : v)
std::cout << e << " ";
std::cout << "n";
}
while (std::next_permutation(v.begin(), v.end()));
}
For pedagocical purposes, if you wanted to keep your current structure, you could also use standard functions there. In particular, remove_item
and merge
could be rewritten to:
std::vector<int> remove_item(const std::vector<int>& a, int id)
{
assert(id >= 0 && id < a.size());
std::vector<int> res(a.begin(), a.begin() + id);
res.insert(res.end(), a.begin() + id + 1, a.end());
return res;
}
std::vector<std::vector<int> > merge(const std::vector<std::vector<int> >& a, const std::vector<std::vector<int> >& b)
{
std::vector<std::vector<int> > res(a);
std::copy(b.begin(), b.end(), std::back_inserter(res));
return res;
}
Whatever you do, as general comments:
Avoid writing
using namespace std;
.Don't write
std::endl
whenn
will do.You don't need
std::to_string
, just printb
.
You are more likely to make mistakes when you put multiple statements on the same line. So instead of writing
for(...) if(...) v.push_back(x);
just write
for(...)
{
if(...)
{
v.push_back(x);
}
}
This also improves readability.
edited 12 hours ago
answered 16 hours ago
JuhoJuho
1,736712
1,736712
1
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
1
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
add a comment |
1
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
1
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
1
1
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
Sure, but using the standard library makes it trivial My goal was to develop a working algo
$endgroup$
– Nicola Bernini
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
$begingroup$
@NicolaBernini Indeed, I hope that nobody is discouraged from reviewing your code beyond my answer.
$endgroup$
– Juho
12 hours ago
1
1
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@NicolaBernini Trust Juho, you will be able to write better algorithms if you learn the standard library.
$endgroup$
– WooWapDaBug
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@WooWapDaBug I already know it (at least at some extent, there is always room for improvement) but I hope it is clear it was not the point of the exercise
$endgroup$
– Nicola Bernini
11 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
$begingroup$
@NicolaBernini It wasn't, but now the relevant tag is added so it is.
$endgroup$
– Mast
9 hours ago
add a comment |
Nicola Bernini is a new contributor. Be nice, and check out our Code of Conduct.
Nicola Bernini is a new contributor. Be nice, and check out our Code of Conduct.
Nicola Bernini is a new contributor. Be nice, and check out our Code of Conduct.
Nicola Bernini is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f217939%2fcompute-all-the-permutations-for-a-given-vector-of-integers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown