java实现版
private boolean add(int newPosition,T newEntry){
boolean issuccessful=ture;
if(newPosition>=1)&&(newPosition<=length+1){
Node newNode=new Node(newEntry);
if(newPosition==1){
newNode.next=fristnode;
fristnode=newNode;
}else{
Node beforeNode=getNodeAt(newPosition-1);
Node afterNode=beforeNode.next;
newNode.next=afterNode;
beforeNode.next=newNode;
}
}else{
issuccessful=false;
}
return issuccessful;
}