Copyright: https://blog.csdn.net/qq_21852449/article/details/85225775
- data structure
- Inheritance & realization
- Attributes
//大小
transient int size;
//第一个节点
transient LinkedList.Node<E> first;
//最后一个节点
transient LinkedList.Node<E> last;
- Construction method
//默认长度为0
public LinkedList() {
this.size = 0;
}
//可传入Collection
public LinkedList(Collection<? extends E> var1) {
this();
this.addAll(var1);
}
- method
public E getFirst() {...}
public E getLast() {...}
public E removeFirst() {...}
public E removeLast() {...}
public void addFirst(E e){...}
public void addLast(E e){...}
public boolean remove(Object var){...}
- Summary
LinkedList is a linked list data structure to achieve, when the need for frequent insertion, deletion when performance is stronger than LinkedList ArrayList. From its implementation can be seen in the interface LinkedList a doubly linked list (Deque). Linked in JDK1.8 is achieved by the internal nodes represent classes.