## heyahuihh的博客

public static void makeList(List<Integer> lst, int N) {
lst.clear();
for (int i = 0; i < N; i++) {
}
}
Type Time
ArrayList O(N)$O(N)$
LinkedList O(N)$O(N)$

public static void add(List<Integer> lst, int N) {
lst.clear();
for (int i = 0; i < N; i++) {
}
}
Type Time
ArrayList O(N2)$O(N^2)$
LinkedList O(N)$O(N)$

public static int sum(List<Integer> lst, int N) {
int total = 0;
for (int i = 0; i < N; i++) {
total += lst.get(i);
}
}
Type Time
ArrayList O(N)$O(N)$
LinkedList O(N2)$O(N^2)$

# 迭代器

public static void removeEvensVer1(List<Integer> lst) {
int i = 0;
while (i < lst.size()) {
if (lst.get(i) % 2 == 0) {
lst.remove(i);
} else
i++;
}
}

public static void removeEvenVer2(List<Integer> lst) {
for (Integer x : lst) {
if (x % 2 == 0) {
lst.remove(x);
}
}
}

public static void removeEvenVer3(List<Integer> lst) {
Iterator<Integer> iterator = lst.iterator();
while (iterator.hasNext()) {
if (iterator.next() % 2 == 0) {
iterator.remove();
}
}
}

2016-06-18 14:26:44

#### 通过ajax将list传到后台的两种实现方式

2017-12-21 10:46:52

#### 抽象数据类型之表（List）

2016-11-25 15:45:14

2017-07-18 18:55:51

#### 【二】数据结构之List

2017-04-18 20:54:50

2015-09-23 13:03:32

2011-12-29 23:35:44

2014-05-08 11:06:51