Comments (1)
max heap / min heap 이용
설명 참고 : https://www.crocus.co.kr/625
1. 최대 힙의 크기는 최소 힙의 크기와 같거나, 하나 더 크다
[ 최대 힙의 크기 == 최소힙의 크기 || 최대 힙 + 1 == 최소힙의 크기 ]
2. 최대 힙의 최대 원소는 최소 힙의 최소 원소보다 작거나 같다. [최대 힙의 원소 <= 최소 힙 원소 ]
이때 알고리즘에 맞지 않는 다면 최대 힙, 최소 힙의 가장 위의 값을 swap
=> 이때 이 두가지 규칙을 유지해 준다면 항상 최대 힙 top 갑이 중간값이 된다.
from algorithm.
Related Issues (20)
- 트리 / Lazy Propagation / Persistent Segment Tree / sqrt Decomposition HOT 5
- 크루스칼 알고리즘 - 최소 신장 트리(Minimum Spanning Tree / MST ) // Using 서로소 집합 ( Disjoint Set, Union-Find) HOT 2
- 운영체제 HOT 1
- LCS (Longest Common Subsequence)
- 데이터베이스
- 거듭제곱 알고리즘 [백준 1629번 ] HOT 1
- 접근 제어 지시자 / overloading, overriding
- 위상정렬 HOT 1
- LIS / ( lower_bound , upper_bound ) HOT 2
- dfs+dp 문제 유형
- 트리 HOT 2
- 투 포인터 / 슬라이딩 윈도우 HOT 2
- 큐 / 스택 HOT 3
- Chained Matrix Multiplication HOT 1
- MCMF (Minimum Cost Maximum Flow)
- 이분 매칭(Bipartite Matching)
- 기하 ( ccw / 선분 교차 / 볼록 껍질 / rotating 캘리퍼스 / Line sweeping / Convex hull trick ) HOT 4
- DP / (Bitonic Tour ) HOT 1
- 모듈러 연산
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algorithm.