双端链表和双链表之间的差异 [英] difference between double-ended linked lists and doubly-linked list

查看:157
本文介绍了双端链表和双链表之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



两者之间的主要区别是什么?

解决方案

在双向链表中,每个节点都有两个指针。一个朝向下一个节点,另一个朝向其前一个节点。





在双端链表中,每个节点只有一个指针指向其下一个节点。它与单端链接列表的区别在于,它不包含一个头节点,它包含两个这样的指针(第一个和最后一个),所以有人能够插入元素从两端列出





(最后一张照片不是那么清楚,但它抓住了两端。)


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.)

这篇关于双端链表和双链表之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆