반응형
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
- function_template
- data_structure
- connected_component
- template
- singly Linked List
- '0'
- red-black tree
- 총정리
- sort
- c++
- 알고리즘
- 자료구조
- deletion
- 문법
- class_template
- Heap
- Articulation_Point
- 예제
- 5397
- qsort
- 13305
- sstream
- Pair
- list
- Algorithm
- Biconnected_Component
- 백준
- 구현
- STL
- Critical_Path_Analysis
Archives
- Today
- Total
- Today
- Total
- 방명록
목록Datastructure (1)
어제의 나보다 성장한 오늘의 나
[c++][자료구조] heap 구현 / STL / Priority Queue 총 정리
Heap 이란? ◎ complete binary tree (parent node는 2개의 child node를 갖는다.) ◎ parent 와 child 간에 항상 대소 관계가 성립 ◎ parent node가 child node 보다 항상 크면 max heap, 항상 작으면 min heap ◎ max heap일때는 최상위 node가 가장 크고 , min heap일때는 최상위 node가 가장 작다. ◎ array의 index는 1 부터 사용한다. ◎ child index는 (parent_index)*2 , (parent_index)*2+1 ◎ 반대로 parent index는 (child_index) / 2 1. heap 구현 Array를 이용하여 Maxheap을 구현해보았다. 변수 / 생성자 / 소멸자 pr..
c++/data_structure_구현
2022. 2. 12. 16:04