这种简单的设计,很有可能是考虑到数据操作都符合后进先出(LIFO )规则,这意味着访问栈的内容并不需要复杂的数据结构,一个简单的栈顶指针就能搞定一切。
This simple design, possible because the data obeys strict LIFO order, means that no complex data structure is needed to track stack contents - a simple pointer to the top of the stack will do.
在此过程中,我还发现了Linda没有提及的关于栈的其他内容。
In the process, I also managed to discover a few things Linda had forgotten about stacks.
好像一旦控制权传递给了尾部调用的函数,栈中就再也没有有用的内容了。
It seems that once control is passed to the tail-called function, nothing in the stack is useful anymore.
应用推荐