正在加载图片...
Chapter 4 Data Structure 4.2 Stacks One of the properties of a list that makes a linked structure more inviting than a contiguous one is the need to insert and delete entries inside the list Recall that it was such operations that had the potential of forcing the massive movement of names to fill or create holes in the case of a contiguous list. If we restrict such operations to the ends of the structure, we find that the use of a contiguous structure becomes a more convenient system. An example of this phenomenon is a stack, which is a list in which all insertions and deletions are performed at the same end of the structure. A consequence of this restriction is that the last entry entered will always be the first entry removed--an observation that leads to stacks being known as last-in, first-out (LIFO) structures. 插入和删除记录的需求是使链接表结构比邻接表结构更诱人的原因之一。 让我们回想一下在邻接表中具有填补和创建存储空缺能力的操作。如果我 们限制这种操作只可以在结构的尾部进行,则邻接表就是一种比较方便的 系统。这种现象的一个例子就是堆栈。在堆栈中,插入和删除操作都在结 构的相同末端进行。如此限制的结果就是最后一个进入表的记录也就是第 个从表中删除的记录。这种结构称为后进先出结构。 A什算机专出英语 4-10Chapter 4 Data Structure 计算机专业英语 4-10 One of the properties of a list that makes a linked structure more inviting than a contiguous one is the need to insert and delete entries inside the list. Recall that it was such operations that had the potential of forcing the massive movement of names to fill or create holes in the case of a contiguous list. If we restrict such operations to the ends of the structure, we find that the use of a contiguous structure becomes a more convenient system. An example of this phenomenon is a stack, which is a list in which all insertions and deletions are performed at the same end of the structure. A consequence of this restriction is that the last entry entered will always be the first entry removed--an observation that leads to stacks being known as last-in,first-out(LIFO)structures. 插入和删除记录的需求是使链接表结构比邻接表结构更诱人的原因之一。 让我们回想一下在邻接表中具有填补和创建存储空缺能力的操作。如果我 们限制这种操作只可以在结构的尾部进行,则邻接表就是一种比较方便的 系统。这种现象的一个例子就是堆栈。在堆栈中,插入和删除操作都在结 构的相同末端进行。如此限制的结果就是最后一个进入表的记录也就是第 一个从表中删除的记录。这种结构称为后进先出结构。 4.2 Stacks
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有