双端链表和双向链表的区别 [英] difference between double-ended linked lists and doubly-linked list
问题描述
我不明白双端和双向链表之间的区别.
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.
在双端链表中,每个节点只有一个指向其下一个节点的指针.它与单端链表的不同之处在于,它包含两个这种类型的指针(first"和last"),而不是只有一个头"节点,因此有人可以从两端插入元素到链表
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.)
这篇关于双端链表和双向链表的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!