Answers for "permutation c++"

C++
1

permutation c++

bool next_permutation(BidirectionalIterator first, BidirectionalIterator last);
bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last);

//Example:
 int a[]={1,2,3,4};
 do {
	for(auto& i : a) cout<<i<<" ";
	cout<<endl;
 } while (next_permutation(a,a+4));
Posted by: Guest on May-06-2021

Browse Popular Code Answers by Language