반응형
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
- 총정리
- STL
- 13305
- Heap
- class_template
- 구현
- 알고리즘
- sort
- Pair
- 예제
- template
- c++
- Critical_Path_Analysis
- function_template
- 자료구조
- connected_component
- '0'
- red-black tree
- sstream
- Articulation_Point
- qsort
- data_structure
- deletion
- 백준
- Algorithm
- Biconnected_Component
- 5397
- list
- 문법
- singly Linked List
Archives
- Today
- Total
- Today
- Total
- 방명록
목록Pair (2)
어제의 나보다 성장한 오늘의 나
[C++] Priority Queue & Pair 사용법
Priortity Queue와 Pair를 함께 사용하면 어떤 기능을 할 수 있는지 알아보자. ① 기본적인 사용 첫 번째 인자 기준으로 내림차순 정렬, 같다면 두 번째 인자를 기준으로 내림차순 정렬. priority_queue pq; pq.push({1,2}); pq.push({1,3}); pq.push({2,2}); pq.push({2,5}); pq.push({3,1}); while(!pq.empty()){ cout
c++
2022. 2. 12. 16:27
[C++] Pair 와 Tuple
문제를 풀다보면 연관이 있는 데이터들을 묶어서 사용하고 싶을 때가 있다. 이 때 사용하는 기능이 Pair 와 Tuple이다. Pair는 2쌍 , Tuple은 3쌍 으로 묶을 수 있다. 헤더 파일 Pair -> #include (생략 가능) Tuple -> #include ---------------------------------------------------------------------------------------------------------------------------------- Pair Coding vector v_pair; // vector 에서의 pair 사용. v_pair.push_back(make_pair(1,"first")); // pair는 function 을 통해 만들..
c++/문법
2022. 2. 10. 23:20