STL 알고리듬(Algorithm)
2020. 8. 12. 01:30ㆍ프로그래밍/C++
STL 알고리듬이란?
요소 범위에서 쓸 수 있는 함수들
> [처음, 마지막) (처음 포함 마지막 미포함)
배열 또는 몇몇 STL 컨테이너에 쓸 수 있음
반복자를 통해 컨테이너에 접근
컨테이너의 크기를 변경하지 않음
> 따라서 추가 메모리 할당도 없음
STL 알고리듬의 유형
#include <algorithm>
> 변경 불가 순차(sequence) 연산 : find(), for_each(), ...
> 변경 가능 순차 연산 : copy(), swap(), ...
> 정렬 관련 연산 : sort(), merge(), ...
#include <numeric>
> 범용 수치 연산 : accumulate(), ...
STL 알고리듬 목록
http://www.cplusplus.com/reference/algorithm/
- C++ Reference
library Standard Template Library: Algorithms The header defines a collection of functions especially designed to be used on ranges of elements. A range is any sequence of objects that can be accessed through iterators or pointers, such as an a
www.cplusplus.com
출처 : 포큐아카데미 C++ 언매니지드 프로그래밍
'프로그래밍 > C++' 카테고리의 다른 글
nullptr, 고정 폭 정수형, enum class (0) | 2020.09.21 |
---|---|
auto, static_assert, default/delete, final/override, offsetof (0) | 2020.09.21 |
템플릿(Template) 프로그래밍 2 (0) | 2020.08.10 |
템플릿(Template) 프로그래밍 1 (0) | 2020.07.26 |
큐(Queue) / 스택(Stack) / 리스트(List) 등 (0) | 2020.07.06 |