Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

Study

STL algorithm - next_permutation 본문

알고리즘/C++ 개념

STL algorithm - next_permutation

^_^? 2021. 2. 2. 23:44

● next_permutation

 

 - #include <algorithm> 헤더에 포함

 

 - 기본 형식

    bool next_permutation(BidirectionalIterator first, BidirectionalIterator last);  

 

 - 순열: 서로 다른 n개 중에 r개를 선택하는 경우의 수 (순서 상관 있음)

 

 - [first, last) 범위의 요소를 사전 순으로 더 큰 순열로 다시 정렬

 

 - 더 큰 순열로 객체를 재 배열 할 수있는 경우 true 반환

 

 

 - Example

 

 

- 실행 결과

 

 


-참고 사이트

coding-factory.tistory.com/606

twpower.github.io/82-next_permutation-and-prev_permutation

www.cplusplus.com/reference/algorithm/next_permutation/

  

'알고리즘 > C++ 개념' 카테고리의 다른 글

  (0) 2021.05.07
STL algorithm - find()  (0) 2021.02.07
STL algorithm - unique함수를 이용한 문자열 중복제거  (0) 2021.02.02
문자 다루기 - <locale>헤더 파일  (0) 2021.01.12
stack, queue에서 pair 사용  (0) 2021.01.07