일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- number theory
- fenwick tree
- floyd-warshall algorithm
- greedy algorithm
- dynamic programming
- depth-first search
- breadth-first search
- String
- binary search algorithm
- prefix sum
- longest increasing subsequence
- Sorting Algorithm
- combinatorics
- parametric search
- lv2
- disjoint-set data structure
- segment tree
- lv4
- Tree
- *
- shortest path problem
- knapsack problem
- LV0
- minimum spanning tree
- LV1
- lv3
- flood fill
- bit masks
- brute-force search
- priority queue
- Today
- 7
- Total
- 61,627
목록STL (4)
codedoc
deque- Random access iterator- 덱(deque) 시작과 끝에서의 삽입/삭제 모두(amortized) 상수 시간- 덱(deque)의 중간에서의 삽입/삭제는 덱의 크기에 선형 시간- Member functionn vector member function + push_front(), pop_front() Iteratorsbegin시작 주소 리턴end끝 주소 리턴 Capacitysize크기를 리턴resize크기 조절empty비어있는지 확인 Element accessfront첫 원소에 접근back끝 원소에 접근 Modifierspush_back끝 부분에 원소 추가push_front앞 부분에 원소 추가pop_back마지막 원소 제거pop_front처음 원소 제거insert원소 삽입erase원..
Vector- c 스타일의 배열과 유사한 동적 배열(dynamic array)- Random access iterator- 벡터(vector) 끝에서의 삽입/삭제 모두 (amortized) 상수 시간- 벡터(vector)의 시작이나 중간에서의 삽입/삭제는 선형 시간 Iteratorsbegin시작 주소 리턴end끝 주소 리턴 Capacitysize크기를 리턴resize크기 조절empty비어있는지 확인 Element accessfront첫 원소에 접근back끝 원소에 접근 Modifierspush_back끝 부분에 원소 추가pop_back마지막 원소 제거insert원소 삽입erase원소 삭제swap원소 위치 바꾸기clear비우기 예제push_back, pop_back 이용소스출력#include#include..
우선순위 큐는 일반 큐와는 다르게 현재 저장된 값들 중 최댓값 혹은 최솟값을 내놓습니다.하나 push 혹은 pop 할 때 시간복잡도는 O(logN) 입니다. +) class 이용http://gigi.nullneuron.net/comp/cpp-stl-priority-queue.php push(X) // 우선순위 큐에 새로운 값을 추가top() // 우선순위 큐의 루트 노드 리턴pop() // 우선순위 큐에서 루트 노드를 삭제size() // 우선순위 큐 내에 포함된 원소들의 수를 리턴empty() // 우선순위 큐가 empty이면 true를 리턴 우선순위 큐 중 최댓값을 내놓는 것을 Max 힙, 최솟값을 내놓는 것을 Min 힙이라고 부릅니다.Max 힙을 사용할 때는1. priority_queue< int,..
이건 프로그래밍 경시에 나간다면 절대 모르면 안된다. 컴퓨터 사양에 따라 다르겠지만보통 stl sort는 1초 안에 1,000,000개 데이터는 껌으로 정렬하고 5,000,000개는 조금 아슬하다.경우에 따라 사용해 보자. sort- sort(시작주소,끝주소+1)- sort(시작주소,끝주소+1,조건자)* [b,e) 구간 이란 b이상 e미만을 뜻한다.일반적인 정수형 배열방의 전체 오름차순 정렬 소스 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include #include using namespace std; int main(){ int A[10]={72,96,15,26,25,43,56,50,30,64}; int B[10]={72,96,15,26,25,43,56,..