单链和双链表(Java)

时间:2022-09-05 19:51:50

Is LinkedList from java.util doubly linked list? And do i need to implement my own singly linked list or there is any class for this in java.util?

LinkedList是否来自java.util双向链表?我需要实现我自己的单链表,还是java.util中有任何类?

Just can't find straight answers over web.

只是无法通过网络找到直接的答案。

1 个解决方案

#1


3  

From the LinkedList API documentation:

从LinkedList API文档:

All of the operations perform as could be expected for a doubly-linked list.

对于双向链表,所有操作都可以预期。

Unless memory is an issue, a double-linked list is sufficient to meet all the needs that a single-linked list can meet.

除非内存是一个问题,否则双链表足以满足单链表可以满足的所有需求。

#1


3  

From the LinkedList API documentation:

从LinkedList API文档:

All of the operations perform as could be expected for a doubly-linked list.

对于双向链表,所有操作都可以预期。

Unless memory is an issue, a double-linked list is sufficient to meet all the needs that a single-linked list can meet.

除非内存是一个问题,否则双链表足以满足单链表可以满足的所有需求。