正在加载图片...
Chapter 4 Data Structure 4.2 Stacks Stack Implementation To implement a stack structure in a computer's memory, it is customary to reserve a block of contiguous memory cells large enough to accommodate the stack as it grows and shrinks. (Determining the size of this block can often be a critical decision. If too little room is reserved. the stack ultimately exceeds the allotted storage space; if too much room is reserved, memory space will be wasted. One end of this block is designated as the stack's base. It is here that the first entry pushed on the stack is stored, with each additional entry being placed next to its predecessor as the stack grows toward the other end of the reserved block 栈的实现 为了在计算机存储中实现栈结构,一般采取的方法是保留一块足够容纳栈大小变化 的内存单元。(通常来说,确定块的大小是一个很重要的任务。如果保留的空间过 小,那么栈最后可能从所分配的存储空间中溢出;而如果保留的空间过大,又是一 种浪费。)块的一端作为栈底,栈的第一条数据会被存储在这里,以后的条目被依 次放置在它之后的存储单元中,也就是堆栈向另外一端增加。 计算机专些英语 4-16Chapter 4 Data Structure 计算机专业英语 4-16 Stack Implementation To implement a stack structure in a computer's memory, it is customary to reserve a block of contiguous memory cells large enough to accommodate the stack as it grows and shrinks. (Determining the size of this block can often be a critical decision. If too little room is reserved, the stack ultimately exceeds the allotted storage space; if too much room is reserved, memory space will be wasted.) One end of this block is designated as the stack's base. It is here that the first entry pushed on the stack is stored, with each additional entry being placed next to its predecessor as the stack grows toward the other end of the reserved block. 栈的实现 为了在计算机存储中实现栈结构,一般采取的方法是保留一块足够容纳栈大小变化 的内存单元。(通常来说,确定块的大小是一个很重要的任务。如果保留的空间过 小,那么栈最后可能从所分配的存储空间中溢出;而如果保留的空间过大,又是一 种浪费。)块的一端作为栈底,栈的第一条数据会被存储在这里,以后的条目被依 次放置在它之后的存储单元中,也就是堆栈向另外一端增加。 4.2 Stacks
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有