📜  单链接列表和双链接列表之间的区别

📅  最后修改于: 2021-06-29 23:55:44             🧑  作者: Mango

单链接列表简介:单链接列表是一组节点,其中每个节点都有两个字段“数据”和“链接”。 “数据”字段存储实际的一条信息,“链接”字段用于指向下一个节点。基本上,“链接”字段仅是地址。

链表

可疑链接列表简介:可疑链接列表(DLL)包含一个额外的指针,通常称为前一个指针,以及下一个指针和单链接列表中存在的数据。

dll文件

单链表与双链表

Singly linked list (SLL) Doubly linked list (DLL)
SLL has nodes with only a data field and next link field. DLL has nodes with a data field, a previous link field and a next link field.
linkedlist dll
In SLL, the traversal can be done using the next node link only. In DLL, the traversal can be done using the previous node link or the next node link.
The SLL occupies less memory than DLL as it has only 2 fields. The DLL occupies more memory than SLL as it has 3 fields.
Less efficient access to elements. More efficient access to elements.