mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
Prepare 1.0.0 release (#1044)
* Update the book with the thrid revised edition * Fix a typo * Update the contributors' information * Update the mindmap * Update the version number
This commit is contained in:
@ -377,7 +377,7 @@
|
||||
|
||||
综上,我们不能简单地确定哪种实现更加节省内存,需要针对具体情况进行分析。
|
||||
|
||||
## 栈典型应用
|
||||
## 栈的典型应用
|
||||
|
||||
- **浏览器中的后退与前进、软件中的撤销与反撤销**。每当我们打开新的网页,浏览器就会对上一个网页执行入栈,这样我们就可以通过后退操作回到上一个网页。后退操作实际上是在执行出栈。如果要同时支持后退和前进,那么需要两个栈来配合实现。
|
||||
- **程序内存管理**。每次调用函数时,系统都会在栈顶添加一个栈帧,用于记录函数的上下文信息。在递归函数中,向下递推阶段会不断执行入栈操作,而向上回溯阶段则会不断执行出栈操作。
|
||||
|
||||
Reference in New Issue
Block a user