2
ArrayList<LinkedList<Integer>> list;6
list = new ArrayList<>(size);7
for (int i = 0; i < size; i++) {8
list.add(new LinkedList<Integer>());12
public int hash(int key) {13
return key % list.size();16
public int search(int key) {19
LinkedList<Integer> temp = list.get(i);22
for (int j = 0; j < temp.size(); j++) {23
if (key == temp.get(j)) {30
public void add(int key) {31
if (search(key) == -1) {37
public void remove(int key) {38
if (search(key) != -1) {40
list.get(i).remove(Integer.valueOf(key));44
public boolean contains(int key) {45
return search(key) != -1;