问题描述
两者之间的主要区别是什么?
在双向链表中,每个节点都有两个指针。一个朝向下一个节点,另一个朝向其前一个节点。
在双端链表中,每个节点只有一个指针指向其下一个节点。它与单端链接列表的区别在于,它不包含一个头节点,它包含两个这样的指针(第一个和最后一个),所以有人能够插入元素从两端列出
(最后一张照片不是那么清楚,但它抓住了两端。)
I don't understand difference between a double-ended and doubly-linked list.
What is the major difference between the two?
In a doubly linked list, each node has two pointers. One towards its next node and another one towards its previous node.
In a double-ended linked list, each node has just one pointer which points to its next node. Its difference from the single-ended linked list is that instead of just one "head" node, it contains two pointers of this kind ("first" and "last"), so someone is able to insert elements to list from both ends of it.
(Last picture isn't that clear, but it catches the point of the two ends.)
这篇关于双端链表和双链表之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!