【文件属性】:
文件名称:双向链表 链表(C++编写)
文件大小:6KB
文件格式:RAR
更新时间:2014-01-10 07:38:32
链表 双向链表
Our doubly linked lists have two header elements: the "head"
just before the first element and the "tail" just after the
last element. The `prev' link of the front header is null, as
is the `next' link of the back header. Their other two links
point toward each other via the interior elements of the list.
An empty list looks like this:
+------+ +------+
<---| head |<--->| tail |--->
+------+ +------+
A list with two elements in it looks like this:
+------+ +-------+ +-------+ +------+
<---| head |<--->| 1 |<--->| 2 |<--->| tail |<--->
+------+ +-------+ +-------+ +------+
The symmetry(对称) of this arrangement(布置) eliminates(消除) lots of special
cases in list processing. For example, take a look at
list_remove(): it takes only two pointer assignments and no
conditionals. That's a lot simpler than the code would be
without header elements.
(Because only one of the pointers in each header element is used,
we could in fact combine them into a single header element
without sacrificing(牺牲) this simplicity. But using two separate
elements allows us to do a little bit of checking on some
operations, which can be valuable.) */
【文件预览】:
双向链表
----双向链表.ncb(41KB)
----Debug()
----双向链表.opt(53KB)
----双向链表.dsp(4KB)
----双向链表.dsw(541B)
网友评论
- 正在认真学习数据结构,很有用
- 学习数据存储的原理,链表是最基本的东东
- 今天试了一下,还可以! 是学习链表的好资料
- 非常不错的例子,可以直接使用,非常感谢分享。