ホーム
|
ブログ
|
C++辞典
|
サイトマップ
|
FAQ
|
掲示板
|
リンク集
メイン・メニュー
ホーム
サイト内検索
インフォメーション
ニュース
ブログ
FAQ
リンク集
インデックス
あ
い
う
え
お
か
き
く
け
こ
さ
し
す
せ
そ
た
ち
つ
て
と
な
に
ぬ
ね
の
は
ひ
ふ
へ
ほ
ま
み
む
め
も
や
ゆ
よ
ら
り
る
れ
ろ
わ
記号
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
プログラミング
Boostを使う! C++入門
標準C++辞典
フリー開発環境
C++と組み込み環境
標準Cライブラリの実装
移植性のあるCプログラミング
JSPカーネル ドキュメント
OSEKカーネル ドキュメント
FDMPカーネル ドキュメント
Doxygen翻訳サイト
その他
株式会社きじねこ
きじねこソフトウェア
きじねこマーケット
靴のストロール
セルオーバー.net
ウェブボーイ
ホームページ・プランニング
マニアック商店街
月1万円からの副収入
旧ブログ
<algorithm>ヘッダ/25.3整列及びその関連演算
をテンプレートにして作成
[
トップ
] [
一覧
|
単語検索
]
開始行:
#navi(<algorithm>ヘッダ)
**整列及びその関連演算 (sorting and related operations) [...
&aname(sort);
***sort [#i2ccb711]
整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''sort''([[RandomAccessIterator>反復子...
template<class [[RandomAccessIterator>反復子#rando...
void ''sort''([[RandomAccessIterator>反復子...
''[[引数]]''~
'''first''': 整列対象となる列の先頭要素を指す [[Ra...
'''last''': 整列対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') で定義される列を整列する。
''計算量''~
平均的に '''N''' log '''N''' 回の比較が行われる。ただし...
''参照''~
→ [[stable_sort>#stable_sort]]
&aname(stable_sort);
***stable_sort [#u610894d]
安定な整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''stable_sort''([[RandomAccessIterator...
template<class [[RandomAccessIterator>反復子#rando...
void ''stable_sort''([[RandomAccessIterator...
&...
''[[引数]]''~
'''first''': 整列対象となる列の先頭要素を指す [[Ra...
'''last''': 整列対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') で定義される列を整列する...
''計算量''~
多くとも '''N''' (log '''N''')²回の比較を行う。メ...
''参照''~
→ [[sort>#sort]]
&aname(partial_sort);
***partial_sort [#h9b2ba01]
部分整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''partial_sort''([[RandomAccessIterato...
&...
template<class [[RandomAccessIterator>反復子#rando...
void ''partial_sort'']([[RandomAccessIterat...
&...
''[[引数]]''~
'''first''': 整列対象となる列の先頭要素を指す [[Ra...
'''middle''': 整列結果となる列の終端要素の次を指す...
'''last''': 整列対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') を整列した場合の最初の '...
''計算量''~
ほぼ ('''last''' - '''first''')×log('''middle''' - '''f...
''参照''~
→ [[partial_sort_copy>#partial_sort_copy]]
&aname(partial_sort_copy);
***partial_sort_copy [#nc0eebc3]
部分整列とコピー
''形式''~
template<class [[InputIterator>反復子#input]], cla...
[[RandomAccessIterator>反復子#random-access...
''partial_sort_copy''([[Input...
&...
&...
template<class [[InputIterator>反復子#input]], cla...
[[RandomAccessIterator>反復子#random-access...
''partial_sort_copy''([[Input...
&...
&...
&...
''[[引数]]''~
'''first''': 元の列の先頭要素を指す [[InputIterato...
'''last''': 元の列の終端要素の次を指す [[InputIter...
'''result_first''': 出力先となる列の先頭要素を指す...
'''result_last''': 出力先となる列の終端要素の次を...
'''comp''': 比較関数~
''[[返却値]]''~
結果の列の終端要素の次を指す[[反復子]]を返す。
''解説''~
'''first''' から始まる、区間 ['''first''', '''last''') ...
''計算量''~
ほぼ ('''last''' - '''first''')×log( min( ('''last''' -...
''参照''~
→ [[partial_sort>#partial_sort]]
&aname(nth_element);
***nth_element [#l5e12654]
基準位置による列の分割
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''nth_element''([[RandomAccessIterator...
&...
template<class [[RandomAccessIterator>反復子#rando...
void ''nth_element''([[RandomAccessIterator...
&...
''[[引数]]''~
'''first''': 分割対象となる列の先頭要素を指す [[Ra...
'''nth''': 分割の基準位置を指す [[RandomAccessIter...
'''last''': 分割対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''nth''') にある任意の[[反復子]] ''...
''計算量''~
平均で線形である。
&aname(lower_bound);
***lower_bound [#ad89ff0a]
順を乱さずに要素を挿入できる下限
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''lower_...
&...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''lower_...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
順を乱さずに '''value''' を挿入できる最初の位置 (下限) ...
''解説''~
区間 ['''first''', '''last''') にある任意の[[反復子]] '...
''計算量''~
多くとも log('''last''' - '''first''') + 1 回の比較が行...
''参照''~
→ [[upper_bound>#upper_bound]], [[equal_range>#equal_rang...
&aname(upper_bound);
***upper_bound [#cb1508e7]
順を乱さずに要素を挿入できる上限
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''upper_...
&...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''upper_...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
順を乱さずに '''value''' を挿入できる最後の位置 (上限) ...
''解説''~
区間 ['''first''', '''last''') にある任意の[[反復子]] '...
''計算量''~
多くとも log('''last''' - '''first''') + 1 回の比較が行...
''参照''~
→ [[lower_bound>#lower_bound]], [[equal_range>#equal_rang...
&aname(equal_range);
***equal_range [#oc0683c5]
順を乱さずに要素を挿入できる範囲
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
pair<[[ForwardIterator>反復子#forward]], [[...
''equal_range''([[ForwardIter...
template<class [[ForwardIterator>反復子#forward]],...
pair<[[ForwardIterator>反復子#forward]], [[...
''equal_range''([[ForwardIter...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
返却値のメンバ .first には '''value''' を順を乱さずに要...
''解説''~
区間 ['''first''', '''last''') にある任意の[[反復子]] '...
''計算量''~
多くとも 2×log('''last''' - '''first''') + 1 回の比較が...
''参照''~
→ [[lower_bound>#lower_bound]], [[upper_bound>#upper_boun...
&aname(binary_search);
***binary_search [#i3314fda]
二分探索
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
bool ''binary_search''([[ForwardIterator>反...
template<class [[ForwardIterator>反復子#forward]],...
bool ''binary_search''([[ForwardIterator>反...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
探索に成功すれば true を、失敗すれば false を返す。
''解説''~
区間 ['''first''', '''last''') にある[[反復子]] '''iter...
''計算量''~
多くとも log('''last''' - '''first''') + 2 回の比較が行...
''参照''~
→ [[bsearch><cstdlib>ヘッダ#bsearch]]
&aname(merge);
***merge [#p96ceabb]
併合
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''merge''(...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''merge''(...
&...
&...
''[[引数]]'''~
'''first1''': 第 1 区間の先頭要素を指す [[InputIte...
'''last1''': 第 1 区間の終端要素の次を指す [[Input...
'''first2''': 第 2 区間の先頭要素を指す [[InputIte...
'''last2''': 第 2 区間の終端要素の次を指す [[Input...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
2 つの整列された区間を併合する。構築された集合は昇順に...
''計算量''~
多くとも ('''last1''' - '''first1''') + ('''last2''' - ...
''参照''~
→ [[inplace_merge>#inplace_merge]]
&aname(inplace_merge);
***inplace_merge [#y2f644d3]
連続区間の併合
''形式''~
template<class [[BidirectionalIterator>反復子#bidi...
void ''inplace_merge''([[BidirectionalItera...
&...
template<class [[BidirectionalIterator>反復子#bidi...
void ''inplace_merge''([[BidirectionalItera...
&...
''[[引数]]''~
'''first''': 第 1 区間の先頭要素を指す [[Bidirecti...
'''middle''': 第 1 区間の終端要素の次であり、かつ...
'''last''': 第 2 区間の終端要素の次を指す [[Bidire...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
2 つの連続している整列された区間 ['''first''', '''middl...
''計算量''~
メモリが十分にある場合には ('''last''' - '''first''') -...
''参照''~
→ [[merge>#merge]]
&aname(includes);
***includes [#bfd44fba]
部分集合の判別
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
bool ''includes''([[InputIterator1>反復子#i...
&...
template<class [[InputIterator1>反復子#input]], cl...
bool ''includes''([[InputIterator1>反復子#i...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
第 2 集合が第 1 集合の部分集合であれば true を、そうで...
''解説''~
区間 ['''first2''', '''last2''') で定義される集合のすべ...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
&aname(set_union);
***set_union [#jd0f466f]
集合の和
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_unio...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_unio...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
2 つの区間の和集合、すなわち、区間 ['''first1''', '''la...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_intersection>#set_intersection]]
&aname(set_intersection);
***set_intersection [#j84a4e5b]
集合の積
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_inte...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_inte...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
2 つの区間の積集合、すなわち、区間 ['''first1''', '''la...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_union>#set_union]]
&aname(set_difference);
***set_difference [#i312d9b2]
集合の差
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_diff...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_diff...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
区間 ['''first1''', '''last1''') で定義される第 1 集合...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_symmetric_difference>#set_symmetric_difference]]
&aname(set_symmetric_difference);
***set_symmetric_difference [#xdf534dc]
集合の対称差
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_symm...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_symm...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
区間 ['''first1''', '''last1''') で定義される第 1 集合...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_difference>#set_difference]]
&aname(push_heap);
***push_heap [#pf438c6b]
[[ヒープ]]に要素を追加
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''push_heap''([[RandomAccessIterator>...
template<class [[RandomAccessIterator>反復子#rando...
void ''push_heap''([[RandomAccessIterator>...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
'''last''' - 1 の位置にある要素を移動し、区間 ['''first...
''計算量''~
多くとも log('''last''' - '''first''') 回の比較が行われ...
''参照''~
→ [[pop_heap>#pop_heap]], [[make_heap>#make_heap]], [[sor...
&aname(pop_heap);
***pop_heap [#d7f8de06]
[[ヒープ]]から要素を除去
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''pop_heap''([[RandomAccessIterator>反...
template<class [[RandomAccessIterator>反復子#rando...
void ''pop_heap''([[RandomAccessIterator>反...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
'''first''' の位置にある要素と '''last''' - 1 の位置に...
''計算量''~
多くとも 2×log('''last''' - '''first''') 回の比較が行わ...
''参照''~
→ [[push_heap>#push_heap]], [[make_heap>#make_heap]], [[s...
&aname(make_heap);
***make_heap [#u1e529f6]
[[ヒープ]]の構築
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''make_heap''([[RandomAccessIterator>...
template<class [[RandomAccessIterator>反復子#rando...
void ''make_heap''([[RandomAccessIterator>...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') から[[ヒープ]]を構築する。
''計算量''~
多くとも 3×('''last''' - '''first''') 回の比較が行われ...
''参照''~
→ [[push_heap>#push_heap]], [[pop_heap>#pop_heap]], [[sor...
&aname(sort_heap);
***sort_heap [#oda7922b]
[[ヒープ]]の整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''sort_heap''([[RandomAccessIterator>...
template<class [[RandomAccessIterator>反復子#rando...
void ''sort_heap''([[RandomAccessIterator>...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') で定義される[[ヒープ]]を...
''計算量''~
多くとも '''N''' log '''N''' 回の比較が行われる。ただし...
''参照''~
→ [[push_heap>#push_heap]], [[pop_heap>#pop_heap]], [[mak...
&aname(min);
***min [#s8ace75b]
最小値
''形式''~
template<class T> const T& min(const T& '''a''', c...
template<class T, class Compare>~
const T& ''min''(const T& '''a''', const T&...
''[[引数]]''~
'''a''': ~
'''b''': ~
'''comp''': 比較関数。型 T は LessThanComparable ...
''[[返却値]]''~
最小値を返す。
''解説''~
'''a''' と '''b''' を比較し、小さい方を返す。最初の形式...
''参照''~
→ [[max>#max]]
&aname(max);
***max [#t9fad70b]
最大値
''形式''~
template<class T> const T& max(const T& '''a''', c...
template<class T, class Compare>~
const T& ''max''(const T& '''a''', const T&...
''[[引数]]''~
'''a''': ~
'''b''': ~
'''comp''': 比較関数。型 T は LessThanComparable ...
''[[返却値]]''~
最大値を返す。
''解説''~
'''a''' と '''b''' を比較し、大きい方を返す。最初の形式...
''参照''~
→ [[min>#min]]
&aname(min_element);
***min_element [#m5ce69f6]
最小要素の探索
''形式''~
template<class [[ForwardIterator>反復子#forward]]>~
[[ForwardIterator>反復子#forward]] ''min_el...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''min_el...
&...
''[[引数]]''~
'''first''': 探索対象の先頭要素を指す [[ForwardIte...
'''last''': 探索対象の終端要素の次を指す [[Forward...
'''comp''': 比較関数~
''[[返却値]]''~
最小要素を指す[[反復子]]を返す。'''first''' == '''last'...
''解説''~
区間 ['''first''', '''last''') 内の[[反復子]] '''iter1'...
''計算量''~
ちょうど max( ('''last''' - '''first''') - 1, 0) ) 回比...
''参照''~
→ [[max_element>#max_element]]
&aname(max_element);
***max_element [#a94a5c32]
最大要素の探索
''形式''~
template<class [[ForwardIterator>反復子#forward]]>~
[[ForwardIterator>反復子#forward]] ''max_el...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''max_el...
&...
''[[引数]]''~
'''first''': 探索対象の先頭要素を指す [[ForwardIte...
'''last''': 探索対象の終端要素の次を指す [[Forward...
'''comp''': 比較関数~
''[[返却値]]''~
最大要素を指す[[反復子]]を返す。'''first''' == '''last'...
''解説''~
区間 ['''first''', '''last''') 内の[[反復子]] '''iter1'...
''計算量''~
ちょうど max( ('''last''' - '''first''') - 1, 0) ) 回比...
''参照''~
→ [[min_element>#min_element]]
&aname(lexicographical_compare);
***lexicographical_compare [#q04f134b]
辞書純比較
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
bool ''lexicographical_compare'']([[InputIt...
&...
template<class [[InputIterator1>反復子#input]], cl...
bool ''lexicographical_compare''([[InputIte...
&...
&...
''[[引数]]''~
'''first1''': 比較対象となる一方の列の先頭要素を指...
'''last1''': 比較対象となる一方の列の終端要素の次...
'''first2''': 比較対象となる他方の列の先頭要素を指...
'''last2''': 比較対象となる他方の列の終端要素の次...
'''comp''': 比較関数~
''[[返却値]]''~
区間 ['''first1''', '''last1''') の列が区間 ['''first2'...
''解説''~
区間 ['''first1''', '''last1''') で定義される列と区間 [...
''計算量''~
多くとも 2×min( ('''last1''' - '''first1'''), ('''last2...
&aname(next_permutation);
***next_permutation [#x68034f8]
次の順列
''形式''~
template<class [[BidirectionalIterator>反復子#bidi...
bool ''next_permutation''([[BidirectionalIt...
template<class [[BidirectionalIterator>反復子#bidi...
bool ''next_permutation''([[BidirectionalIt...
&...
''[[引数]]''~
'''first''': 先頭要素を指す [[BidirectionalIterato...
'''last''': 終端要素の次を指す [[BidirectionalIter...
'''comp''': 比較関数~
''[[返却値]]''~
次の順列が存在する場合は true を、そうでなければ false ...
''解説''~
区間 ['''first''', '''last''') の列を前の順列に変換する...
''計算量''~
多くとも ('''last''' - '''first''') / 2 の交換が行われ...
''参照''~
→ [[prev_permutation>#prev_permutation]]
&aname(prev_permutation);
***prev_permutation [#i0c378a1]
前の順列
''形式''~
template<class [[BidirectionalIterator>反復子#bidi...
bool ''prev_permutation''([[BidirectionalIt...
template<class [[BidirectionalIterator>反復子#bidi...
bool ''prev_permutation''([[BidirectionalIt...
&...
''[[引数]]''~
'''first''': 先頭要素を指す [[BidirectionalIterato...
'''last''': 終端要素の次を指す [[BidirectionalIter...
'''comp''': 比較関数~
''[[返却値]]''~
前の順列が存在する場合は true を、そうでなければ false ...
''解説''~
区間 ['''first''', '''last''') の列を前の順列に変換する...
''計算量''~
多くとも ('''last''' - '''first''') / 2 の交換が行われ...
''参照''~
→ [[next_permutation>#next_permutation]]
終了行:
#navi(<algorithm>ヘッダ)
**整列及びその関連演算 (sorting and related operations) [...
&aname(sort);
***sort [#i2ccb711]
整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''sort''([[RandomAccessIterator>反復子...
template<class [[RandomAccessIterator>反復子#rando...
void ''sort''([[RandomAccessIterator>反復子...
''[[引数]]''~
'''first''': 整列対象となる列の先頭要素を指す [[Ra...
'''last''': 整列対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') で定義される列を整列する。
''計算量''~
平均的に '''N''' log '''N''' 回の比較が行われる。ただし...
''参照''~
→ [[stable_sort>#stable_sort]]
&aname(stable_sort);
***stable_sort [#u610894d]
安定な整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''stable_sort''([[RandomAccessIterator...
template<class [[RandomAccessIterator>反復子#rando...
void ''stable_sort''([[RandomAccessIterator...
&...
''[[引数]]''~
'''first''': 整列対象となる列の先頭要素を指す [[Ra...
'''last''': 整列対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') で定義される列を整列する...
''計算量''~
多くとも '''N''' (log '''N''')²回の比較を行う。メ...
''参照''~
→ [[sort>#sort]]
&aname(partial_sort);
***partial_sort [#h9b2ba01]
部分整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''partial_sort''([[RandomAccessIterato...
&...
template<class [[RandomAccessIterator>反復子#rando...
void ''partial_sort'']([[RandomAccessIterat...
&...
''[[引数]]''~
'''first''': 整列対象となる列の先頭要素を指す [[Ra...
'''middle''': 整列結果となる列の終端要素の次を指す...
'''last''': 整列対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') を整列した場合の最初の '...
''計算量''~
ほぼ ('''last''' - '''first''')×log('''middle''' - '''f...
''参照''~
→ [[partial_sort_copy>#partial_sort_copy]]
&aname(partial_sort_copy);
***partial_sort_copy [#nc0eebc3]
部分整列とコピー
''形式''~
template<class [[InputIterator>反復子#input]], cla...
[[RandomAccessIterator>反復子#random-access...
''partial_sort_copy''([[Input...
&...
&...
template<class [[InputIterator>反復子#input]], cla...
[[RandomAccessIterator>反復子#random-access...
''partial_sort_copy''([[Input...
&...
&...
&...
''[[引数]]''~
'''first''': 元の列の先頭要素を指す [[InputIterato...
'''last''': 元の列の終端要素の次を指す [[InputIter...
'''result_first''': 出力先となる列の先頭要素を指す...
'''result_last''': 出力先となる列の終端要素の次を...
'''comp''': 比較関数~
''[[返却値]]''~
結果の列の終端要素の次を指す[[反復子]]を返す。
''解説''~
'''first''' から始まる、区間 ['''first''', '''last''') ...
''計算量''~
ほぼ ('''last''' - '''first''')×log( min( ('''last''' -...
''参照''~
→ [[partial_sort>#partial_sort]]
&aname(nth_element);
***nth_element [#l5e12654]
基準位置による列の分割
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''nth_element''([[RandomAccessIterator...
&...
template<class [[RandomAccessIterator>反復子#rando...
void ''nth_element''([[RandomAccessIterator...
&...
''[[引数]]''~
'''first''': 分割対象となる列の先頭要素を指す [[Ra...
'''nth''': 分割の基準位置を指す [[RandomAccessIter...
'''last''': 分割対象となる列の終端要素の次を指す [...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''nth''') にある任意の[[反復子]] ''...
''計算量''~
平均で線形である。
&aname(lower_bound);
***lower_bound [#ad89ff0a]
順を乱さずに要素を挿入できる下限
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''lower_...
&...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''lower_...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
順を乱さずに '''value''' を挿入できる最初の位置 (下限) ...
''解説''~
区間 ['''first''', '''last''') にある任意の[[反復子]] '...
''計算量''~
多くとも log('''last''' - '''first''') + 1 回の比較が行...
''参照''~
→ [[upper_bound>#upper_bound]], [[equal_range>#equal_rang...
&aname(upper_bound);
***upper_bound [#cb1508e7]
順を乱さずに要素を挿入できる上限
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''upper_...
&...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''upper_...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
順を乱さずに '''value''' を挿入できる最後の位置 (上限) ...
''解説''~
区間 ['''first''', '''last''') にある任意の[[反復子]] '...
''計算量''~
多くとも log('''last''' - '''first''') + 1 回の比較が行...
''参照''~
→ [[lower_bound>#lower_bound]], [[equal_range>#equal_rang...
&aname(equal_range);
***equal_range [#oc0683c5]
順を乱さずに要素を挿入できる範囲
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
pair<[[ForwardIterator>反復子#forward]], [[...
''equal_range''([[ForwardIter...
template<class [[ForwardIterator>反復子#forward]],...
pair<[[ForwardIterator>反復子#forward]], [[...
''equal_range''([[ForwardIter...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
返却値のメンバ .first には '''value''' を順を乱さずに要...
''解説''~
区間 ['''first''', '''last''') にある任意の[[反復子]] '...
''計算量''~
多くとも 2×log('''last''' - '''first''') + 1 回の比較が...
''参照''~
→ [[lower_bound>#lower_bound]], [[upper_bound>#upper_boun...
&aname(binary_search);
***binary_search [#i3314fda]
二分探索
''形式''~
template<class [[ForwardIterator>反復子#forward]],...
bool ''binary_search''([[ForwardIterator>反...
template<class [[ForwardIterator>反復子#forward]],...
bool ''binary_search''([[ForwardIterator>反...
&...
''[[引数]]''~
'''first''': 探索対象となる列の先頭要素を指す [[Fo...
'''last''': 探索対象となる列の終端要素の次を指す [...
'''value''': 探索する値。型 T は LessThanComparable~
'''comp''': 比較関数~
''[[返却値]]''~
探索に成功すれば true を、失敗すれば false を返す。
''解説''~
区間 ['''first''', '''last''') にある[[反復子]] '''iter...
''計算量''~
多くとも log('''last''' - '''first''') + 2 回の比較が行...
''参照''~
→ [[bsearch><cstdlib>ヘッダ#bsearch]]
&aname(merge);
***merge [#p96ceabb]
併合
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''merge''(...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''merge''(...
&...
&...
''[[引数]]'''~
'''first1''': 第 1 区間の先頭要素を指す [[InputIte...
'''last1''': 第 1 区間の終端要素の次を指す [[Input...
'''first2''': 第 2 区間の先頭要素を指す [[InputIte...
'''last2''': 第 2 区間の終端要素の次を指す [[Input...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
2 つの整列された区間を併合する。構築された集合は昇順に...
''計算量''~
多くとも ('''last1''' - '''first1''') + ('''last2''' - ...
''参照''~
→ [[inplace_merge>#inplace_merge]]
&aname(inplace_merge);
***inplace_merge [#y2f644d3]
連続区間の併合
''形式''~
template<class [[BidirectionalIterator>反復子#bidi...
void ''inplace_merge''([[BidirectionalItera...
&...
template<class [[BidirectionalIterator>反復子#bidi...
void ''inplace_merge''([[BidirectionalItera...
&...
''[[引数]]''~
'''first''': 第 1 区間の先頭要素を指す [[Bidirecti...
'''middle''': 第 1 区間の終端要素の次であり、かつ...
'''last''': 第 2 区間の終端要素の次を指す [[Bidire...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
2 つの連続している整列された区間 ['''first''', '''middl...
''計算量''~
メモリが十分にある場合には ('''last''' - '''first''') -...
''参照''~
→ [[merge>#merge]]
&aname(includes);
***includes [#bfd44fba]
部分集合の判別
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
bool ''includes''([[InputIterator1>反復子#i...
&...
template<class [[InputIterator1>反復子#input]], cl...
bool ''includes''([[InputIterator1>反復子#i...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
第 2 集合が第 1 集合の部分集合であれば true を、そうで...
''解説''~
区間 ['''first2''', '''last2''') で定義される集合のすべ...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
&aname(set_union);
***set_union [#jd0f466f]
集合の和
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_unio...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_unio...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
2 つの区間の和集合、すなわち、区間 ['''first1''', '''la...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_intersection>#set_intersection]]
&aname(set_intersection);
***set_intersection [#j84a4e5b]
集合の積
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_inte...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_inte...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
2 つの区間の積集合、すなわち、区間 ['''first1''', '''la...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_union>#set_union]]
&aname(set_difference);
***set_difference [#i312d9b2]
集合の差
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_diff...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_diff...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
区間 ['''first1''', '''last1''') で定義される第 1 集合...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_symmetric_difference>#set_symmetric_difference]]
&aname(set_symmetric_difference);
***set_symmetric_difference [#xdf534dc]
集合の対称差
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
[[OutputIterator>反復子#output]] ''set_symm...
&...
&...
template<class [[InputIterator1>反復子#input]], cl...
&...
[[OutputIterator>反復子#output]] ''set_symm...
&...
&...
''[[引数]]'''~
'''first1''': 比較対象となる第 1 集合の先頭要素を...
'''last1''': 比較対象となる第 1 集合の終端要素の次...
'''first2''': 比較対象となる第 2 集合の先頭要素を...
'''last2''': 比較対象となる第 2 集合の終端要素の次...
'''result''': 結果集合の出力先の先頭要素を指す [[O...
'''comp''': 比較関数~
''[[返却値]]'''~
結果集合の終端要素の次を指す[[反復子]]を返す。
''解説''~
区間 ['''first1''', '''last1''') で定義される第 1 集合...
''計算量''~
多くとも 2×( ('''last1''' - '''first1''') + ('''last2''...
''参照''~
→ [[set_difference>#set_difference]]
&aname(push_heap);
***push_heap [#pf438c6b]
[[ヒープ]]に要素を追加
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''push_heap''([[RandomAccessIterator>...
template<class [[RandomAccessIterator>反復子#rando...
void ''push_heap''([[RandomAccessIterator>...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
'''last''' - 1 の位置にある要素を移動し、区間 ['''first...
''計算量''~
多くとも log('''last''' - '''first''') 回の比較が行われ...
''参照''~
→ [[pop_heap>#pop_heap]], [[make_heap>#make_heap]], [[sor...
&aname(pop_heap);
***pop_heap [#d7f8de06]
[[ヒープ]]から要素を除去
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''pop_heap''([[RandomAccessIterator>反...
template<class [[RandomAccessIterator>反復子#rando...
void ''pop_heap''([[RandomAccessIterator>反...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
'''first''' の位置にある要素と '''last''' - 1 の位置に...
''計算量''~
多くとも 2×log('''last''' - '''first''') 回の比較が行わ...
''参照''~
→ [[push_heap>#push_heap]], [[make_heap>#make_heap]], [[s...
&aname(make_heap);
***make_heap [#u1e529f6]
[[ヒープ]]の構築
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''make_heap''([[RandomAccessIterator>...
template<class [[RandomAccessIterator>反復子#rando...
void ''make_heap''([[RandomAccessIterator>...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') から[[ヒープ]]を構築する。
''計算量''~
多くとも 3×('''last''' - '''first''') 回の比較が行われ...
''参照''~
→ [[push_heap>#push_heap]], [[pop_heap>#pop_heap]], [[sor...
&aname(sort_heap);
***sort_heap [#oda7922b]
[[ヒープ]]の整列
''形式''~
template<class [[RandomAccessIterator>反復子#rando...
void ''sort_heap''([[RandomAccessIterator>...
template<class [[RandomAccessIterator>反復子#rando...
void ''sort_heap''([[RandomAccessIterator>...
&...
''[[引数]]''~
'''first''': [[ヒープ]]の先頭要素を指す [[RandomAc...
'''last''': [[ヒープ]]の終端要素の次を指す [[Rando...
'''comp''': 比較関数~
''[[返却値]]''~
なし
''解説''~
区間 ['''first''', '''last''') で定義される[[ヒープ]]を...
''計算量''~
多くとも '''N''' log '''N''' 回の比較が行われる。ただし...
''参照''~
→ [[push_heap>#push_heap]], [[pop_heap>#pop_heap]], [[mak...
&aname(min);
***min [#s8ace75b]
最小値
''形式''~
template<class T> const T& min(const T& '''a''', c...
template<class T, class Compare>~
const T& ''min''(const T& '''a''', const T&...
''[[引数]]''~
'''a''': ~
'''b''': ~
'''comp''': 比較関数。型 T は LessThanComparable ...
''[[返却値]]''~
最小値を返す。
''解説''~
'''a''' と '''b''' を比較し、小さい方を返す。最初の形式...
''参照''~
→ [[max>#max]]
&aname(max);
***max [#t9fad70b]
最大値
''形式''~
template<class T> const T& max(const T& '''a''', c...
template<class T, class Compare>~
const T& ''max''(const T& '''a''', const T&...
''[[引数]]''~
'''a''': ~
'''b''': ~
'''comp''': 比較関数。型 T は LessThanComparable ...
''[[返却値]]''~
最大値を返す。
''解説''~
'''a''' と '''b''' を比較し、大きい方を返す。最初の形式...
''参照''~
→ [[min>#min]]
&aname(min_element);
***min_element [#m5ce69f6]
最小要素の探索
''形式''~
template<class [[ForwardIterator>反復子#forward]]>~
[[ForwardIterator>反復子#forward]] ''min_el...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''min_el...
&...
''[[引数]]''~
'''first''': 探索対象の先頭要素を指す [[ForwardIte...
'''last''': 探索対象の終端要素の次を指す [[Forward...
'''comp''': 比較関数~
''[[返却値]]''~
最小要素を指す[[反復子]]を返す。'''first''' == '''last'...
''解説''~
区間 ['''first''', '''last''') 内の[[反復子]] '''iter1'...
''計算量''~
ちょうど max( ('''last''' - '''first''') - 1, 0) ) 回比...
''参照''~
→ [[max_element>#max_element]]
&aname(max_element);
***max_element [#a94a5c32]
最大要素の探索
''形式''~
template<class [[ForwardIterator>反復子#forward]]>~
[[ForwardIterator>反復子#forward]] ''max_el...
template<class [[ForwardIterator>反復子#forward]],...
[[ForwardIterator>反復子#forward]] ''max_el...
&...
''[[引数]]''~
'''first''': 探索対象の先頭要素を指す [[ForwardIte...
'''last''': 探索対象の終端要素の次を指す [[Forward...
'''comp''': 比較関数~
''[[返却値]]''~
最大要素を指す[[反復子]]を返す。'''first''' == '''last'...
''解説''~
区間 ['''first''', '''last''') 内の[[反復子]] '''iter1'...
''計算量''~
ちょうど max( ('''last''' - '''first''') - 1, 0) ) 回比...
''参照''~
→ [[min_element>#min_element]]
&aname(lexicographical_compare);
***lexicographical_compare [#q04f134b]
辞書純比較
''形式''~
template<class [[InputIterator1>反復子#input]], cl...
bool ''lexicographical_compare'']([[InputIt...
&...
template<class [[InputIterator1>反復子#input]], cl...
bool ''lexicographical_compare''([[InputIte...
&...
&...
''[[引数]]''~
'''first1''': 比較対象となる一方の列の先頭要素を指...
'''last1''': 比較対象となる一方の列の終端要素の次...
'''first2''': 比較対象となる他方の列の先頭要素を指...
'''last2''': 比較対象となる他方の列の終端要素の次...
'''comp''': 比較関数~
''[[返却値]]''~
区間 ['''first1''', '''last1''') の列が区間 ['''first2'...
''解説''~
区間 ['''first1''', '''last1''') で定義される列と区間 [...
''計算量''~
多くとも 2×min( ('''last1''' - '''first1'''), ('''last2...
&aname(next_permutation);
***next_permutation [#x68034f8]
次の順列
''形式''~
template<class [[BidirectionalIterator>反復子#bidi...
bool ''next_permutation''([[BidirectionalIt...
template<class [[BidirectionalIterator>反復子#bidi...
bool ''next_permutation''([[BidirectionalIt...
&...
''[[引数]]''~
'''first''': 先頭要素を指す [[BidirectionalIterato...
'''last''': 終端要素の次を指す [[BidirectionalIter...
'''comp''': 比較関数~
''[[返却値]]''~
次の順列が存在する場合は true を、そうでなければ false ...
''解説''~
区間 ['''first''', '''last''') の列を前の順列に変換する...
''計算量''~
多くとも ('''last''' - '''first''') / 2 の交換が行われ...
''参照''~
→ [[prev_permutation>#prev_permutation]]
&aname(prev_permutation);
***prev_permutation [#i0c378a1]
前の順列
''形式''~
template<class [[BidirectionalIterator>反復子#bidi...
bool ''prev_permutation''([[BidirectionalIt...
template<class [[BidirectionalIterator>反復子#bidi...
bool ''prev_permutation''([[BidirectionalIt...
&...
''[[引数]]''~
'''first''': 先頭要素を指す [[BidirectionalIterato...
'''last''': 終端要素の次を指す [[BidirectionalIter...
'''comp''': 比較関数~
''[[返却値]]''~
前の順列が存在する場合は true を、そうでなければ false ...
''解説''~
区間 ['''first''', '''last''') の列を前の順列に変換する...
''計算量''~
多くとも ('''last''' - '''first''') / 2 の交換が行われ...
''参照''~
→ [[next_permutation>#next_permutation]]
ページ名:
ホーム
|
プロフィール
|
メール
|
ログイン
|
管理
Copyright © 2005-2009 by
TAKAGI Nobuhisa