A fast NCHOOSEK alternative for engineers who like fast NCHOOSEK alternatives

Versión 1.1.0.0 (2.6 KB) por Jose
This code recursively generates K-subsets of an N-set.
416 descargas
Actualizado 27 Jan 2014

Ver licencia

GETNEXTCOMBINATION returns the next K-subset of an N-set. It implements the "Revolving Door" (NEXKSB) algorithm found in "Combinatorial Algorithms", 2nd Ed., by Albert Nijenhuis and Herbert S. Wilf. It is a recursive alternative to the NCHOOSEK command that is extremely fast (O(1)), at the expense of slightly more user interaction. (You do get something that NCHOOSEK does not give you for
this extra effort: see input "m".) Apart from its efficiency, it is awesome because each new K-subset differs from the last by a single element and the last combination generated differs from the first combination by a single element.

Citar como

Jose (2024). A fast NCHOOSEK alternative for engineers who like fast NCHOOSEK alternatives (https://www.mathworks.com/matlabcentral/fileexchange/45165-a-fast-nchoosek-alternative-for-engineers-who-like-fast-nchoosek-alternatives), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2012a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Whos en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.1.0.0

typos

1.0.0.0