public void removeAllKey(int key) {
Node pre = this.head;
Node cur =this.head.next;
while (cur!=null){
if (cur.data == key){
pre.next = cur.next;
cur = cur.next;
size--;
}else {
pre = cur;
cur = cur.next;
}
}
if(this.head.data==key){
head = head.next;
}
}