Data structures: single doubly-linked list and

Data structures: single doubly-linked list and

As shown below:

16004747-ad75b9865383e771.jpg
Jane from the bottom of the picture book App

Singly linked list:

1, only one-way access. Traversed from start to finish, that can only go forward, not backward.

2, add or delete speed, look slow.


Doubly linked list:

1, supports two-way access. Precursor can access nodes can access successor node, traversal process can retreat.

2, find the speed, speed deletions complicated because of the need to assign a plurality of storage space pointer.


Here we look at singly linked list with two-way usage scenarios.

HashMap: singly linked list

LinkedHashMap: doubly linked list

TreeMap: red-black tree

ArrayList: Array

LinkedList: doubly linked list


Limited personal capacity, will inevitably be the wrong place, please correct me a lot.

Guess you like

Origin blog.csdn.net/weixin_34283445/article/details/90806940