Java ?????LinkedList??????
???????????? ???????[ 2015/1/15 10:51:25 ] ????????Java LinkedList
????3.???????????
????a:??????
public LinkedList() {
}
public LinkedList(Collection<? extends E> c) {
this();
addAll(c);
}
public boolean addAll(Collection<? extends E> c) {
return addAll(size?? c);
}
public boolean addAll(int index?? Collection<? extends E> c) {
checkPositionIndex(index);
Object[] a = c.toArray();
int numNew = a.length;
if (numNew == 0)
return false;
Node<E> pred?? succ;
if (index == size) {
succ = null;
pred = last;
} else {
succ = node(index);
pred = succ.prev;
}
for (Object o : a) {
@SuppressWarnings("unchecked") E e = (E) o;
Node<E> newNode = new Node<>(pred?? e?? null);
if (pred == null)
first = newNode;
else
pred.next = newNode;
pred = newNode;
}
if (succ == null) {
last = pred;
} else {
pred.next = succ;
succ.prev = pred;
}
size += numNew;
modCount++;
return true;
}<br>
|
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????addAll()?????????????????????????????????????addAll()???????????ж?????????????????????????????????????Object????????饗????????飩??
????Node<E> pred?? succ;
????if (index == size) {
????succ = null;
????pred = last;
????} else {
????succ = node(index);
????pred = succ.prev;
????}
????????ж??????????????????????С???????????????????????β??????????β??????pred;???????????????????????????в???????λ?á????????????????????????У?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11