반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Heap
- 예제
- 문법
- Critical_Path_Analysis
- sort
- Pair
- Algorithm
- deletion
- 5397
- template
- 알고리즘
- 구현
- STL
- class_template
- sstream
- data_structure
- red-black tree
- 13305
- 총정리
- connected_component
- singly Linked List
- Biconnected_Component
- qsort
- function_template
- '0'
- 자료구조
- Articulation_Point
- list
- 백준
- c++
Archives
- Today
- Total
- Today
- Total
- 방명록
목록lower_bound (1)
어제의 나보다 성장한 오늘의 나
[c++] 이진 탐색 ( lower_bound , upper_bound ) 사용 및 예제
공통 특징 ◎ 헤더파일 : ◎ iterator 사용 / 반환 ◎ 이진 탐색 구조 / 시간 복잡도 : O(log N) ◎ 오름차순 정렬되어 있어야 한다. ◎ 찾는 값이 벡터/배열 속에 여러 개 있을 경우 가장 앞에 있는 값을 가리키는 iterator 반환 Lower_bound ◎ 찾는 값이 없다면 찾는 값보다 큰 값 중 가장 작은 값을 찾는다. vector v = {6, 2, 3, 4 ,3 ,6 ,6 ,7, 2, 1}; sort(v.begin() , v.end()); // sorted : 1 2 2 3 3 4 6 6 6 7 cout
c++/문법
2022. 2. 13. 16:33