백준 3079번 문제 long long minT = *min_element(times.begin(), times.end()); 이 때 min_element는 ``에 존재하는 함수이며, 가장 작은 원소를 가리키는 iterator이다. 따라서 이 위치가 표시하는 값을 보려
코드 출처 : 삼성 SW Expert Acadamy리본 테이프 K개를 잘라서 길이 L짜리 조각을 N개 이상 만들 수 있는가?모든 리본을 길이 L로 잘랐을 때, 조각을 N개 이상 만들 수 있는 가장 큰 L. 즉, L이 정답이다. 단조성(monotonicity) 을 띄기
events.begin(), events.end() : 정렬할 구간(벡터 전체)\[](const auto& a, const auto& b) { ... } : 비교 함수(Comparator)std::sort는 내부에서 원소 두 개 a, b를 꺼내 a가 b보다 앞에 와야
Call-by-Value vs Call-by-Reference Call by Value : 단지 인자의 값이 사용됨. Call by Reference : 인자는 변수이고, 온전한 변수가 사용됨. 메모리 주소 직접 접근. Overloading 같은 함수 이름으로 두
Bellman-Ford 알고리즘 실제 적용 문제를 해결하기 위해 참조 코드들을 공부하던 중,&가 붙어있는 걸 뒤늦게 알아봤다. 굳이 이게 없어도 문제는 해결되긴 하는데 어떤 역할일까 궁금해서 찾아봤다.&가 없으면 매 반복문마다 새로운 객체를 생성한다. 이 문제 상황에서
Find the shortest path from a starting vertex to all other vertices.The graph is connected.The edge weights are nonnegative.처음 노드에서부터 'cloud'(이미 start
Subgraph that contains all vertices of the original graph and is a tree.즉, 기존 그래프의 모든 노드들을 최소한의 엣지로 연결한 그래프. 사이클 X.ST는 여러 그래프를 가질 수 있다.ST중에서 각 edge we

Vertices and edgesendVertices(e) : an array of two endvertices of e.opposite(v, e) : the vertex opposite of v on e.areAdjacent(v, w) : true if and onl

A graph G = (V, E) : finite set of vertices V and finite set of edges E.V, E는 집합이므로 V에 속한 각 v와 E에 속한 각 e는 unique하다.Edge : (u, v), u와 v는 V에 속한 vertices

Divide the problem into a nnumber of subproblemsConquer the subproblems by solving them recursively. If the subproblem sizes are small enough, just so
get(key)put(key, value)remove(key)size()isEmpty()entrySet()keySet()values()put : O(1), but if uniqueness needed, O(n).get, remove : O(n) in the worst
Strategy > - Break down into smaller problems > - Solve the smaller problems > - Combine results > - Recursive Sorting via divide-and-conquer Merge S
(n-1) + (n-2) + ... + 2 + 1 = n(n-1)/2 ~ O(n^2)Best case : O(n) by flagWorst case : O(n^2)Average case : O(n^2)Best case : O(n^2)Worst case : O(n^2)Av
rear(back)에서 Enqueue, front에서 Dequeue가 일어나는 ordered list.FIFO schemeTypically implemented with array or LLenqueue(Object) from rearObject dequeue() fr
Abstract Data TypeA mathematical model of the data objects that make up a data type as well as the functions that operate on these objects.Defined ind
자료구조의 기초 과제로 '염기 서열 정보 검색 엔진 만들기'를 하다가 갑자기 엉뚱한 생각이 들어서 끄적여본다.우리가 속한 세계는 모두 연속적인 것들로 이뤄져 있다고 생각한다.쉽게 말하면 다분법적 존재가 아닌 연속적인 존재들로, 0과 1이 아닌 그 사이에 무한히 많은 것
Lookup TimeBalanced Tree : O(log n)Unbalanced Tree : O(n)Insertion TimeBalanced Tree : O(log n)Unbalanced Tree : O(n)A Self-balancing binary search tr
Can be done easily by recursionSo, order of visit does matter\-> 좌, print, 우로 움직이기 때문에 binary tree에서만 유효.\-> Printing Arithmetic Expressions 응용 가능.Pri
Consist of nodes and linkes denoting parent-child relation.Special case of graphs with a hierarchical structure but without loops.Each elemept except