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

什么是堆?什么是栈?它们之间有什么区别和联系? #74

Open
LuckyWinty opened this issue Oct 18, 2020 · 1 comment
Open

Comments

@LuckyWinty
Copy link
Owner

No description provided.

@LuckyWinty
Copy link
Owner Author

LuckyWinty commented Oct 18, 2020

堆和栈的概念存在于数据结构中和操作系统内存中。在数据结构中,栈中数据的存取方式为 先进后出。而堆是一个优先队列,是按优先级来进行排序的,优先级可以按照大小来规定。完全 二叉树是堆的一种实现方式。在操作系统中,内存被分为栈区和堆区。栈区内存由编译器自动分 配释放,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。堆区内存一 般由程序员分配释放,若程序员不释放,程序结束时可能由垃圾回收机制回收。

详细资料可以参考: 《什么是堆?什么是栈?他们之间有什么区别和联系?》

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