nas*_*-sh 4 c++ algorithm stl
有没有办法"重置" std::next_permutation()?假设我想多次检查向量的排列.我唯一能找到的就是经历next_permutation和prev_permutation另类.
std::next_permutation()
next_permutation
prev_permutation
谢谢
Nik*_* B. 8
"重置"将对序列进行排序,例如使用std::sort.请注意,如果要使用枚举所有排列,则必须从排序序列开始next_permutation.
std::sort
此外,一旦再次达到按字典顺序排列的最小排列,std::next_permutation将返回false.
std::next_permutation
false
归档时间:
11 年,8 月 前
查看次数:
184 次
最近记录: