A fast NCHOOSEK alternative for engineers who like fast NCHOOSEK alternatives

版本 1.1.0.0 (2.6 KB) 作者: Jose
This code recursively generates K-subsets of an N-set.
421.0 次下载
更新时间 2014/1/27

查看许可证

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.

引用格式

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. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Whos 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

typos

1.0.0.0