Unused Items
Reports the unused items in a partial permutation.
Controller: CodeCogs
Contents
Interface
C++
Unknown
std::vector<int> unused_itemsunknown( | int | n | |
int | npart | ||
int* | part | ) |
References:
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.htmlExample 1
#include <codecogs/maths/combinatorics/permutations/unused_items.h> #include <iostream> int main() { int alpha[5] = {1, 5, 2, 7, 9}, n = 10; std::vector<int> result = Maths::Combinatorics::Permutations::unused_items(n, 5, alpha); std::cout << "The unused values in the partial permutation Alpha are:"; std::cout << std::endl; for (int i = 0; i < result.size(); i++) std::cout << result[i] << " "; std::cout << std::endl; return 0; }
Output:The unused values in the partial permutation Alpha are: 3 4 6 8 10
Returns
- the unused items in the given partial permutation
Authors
- Lucian Bentea (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.