Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二叉堆 | caojiangxia #11

Open
caojiangxia opened this issue Jan 2, 2019 · 0 comments
Open

二叉堆 | caojiangxia #11

caojiangxia opened this issue Jan 2, 2019 · 0 comments

Comments

@caojiangxia
Copy link
Owner

https://caojiangxia.github.io/2019/01/02/heap/#more

什么是二叉堆?二叉堆是什么呢?我的理解是堆是一个数据结构,为了满足我们的需求所精心设计的数据结构。而二叉堆正是为了满足我们的需求而被提出来的,同时它也叫做优先队列,它所能实现的最重要的功能是: 在$n$个元素中通过$\log n$时间找到优先级最大/最小的元素 我们传统的方式是遍历数组去寻找,这样需要花费$n$级别的时间,那么对于大量查询优先级最大/最小的元素情况下,我们使用二叉堆进行优化可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant