Giter Club home page Giter Club logo

Comments (1)

WonYong-Jang avatar WonYong-Jang commented on June 8, 2024

max heap / min heap 이용

설명 참고 : https://www.crocus.co.kr/625

1. 최대 힙의 크기는 최소 힙의 크기와 같거나, 하나 더 크다
[ 최대 힙의 크기 == 최소힙의 크기  || 최대 힙 + 1 == 최소힙의 크기 ]
2. 최대 힙의 최대 원소는 최소 힙의 최소 원소보다 작거나 같다. [최대 힙의 원소 <= 최소 힙 원소 ] 
이때 알고리즘에 맞지 않는 다면 최대 힙, 최소 힙의 가장 위의 값을 swap
=> 이때 이 두가지 규칙을 유지해 준다면 항상 최대 힙 top 갑이 중간값이 된다.



from algorithm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.