Doubly linked list. Remove function and insert in this example
Could me someone help in this functions.
publicvoid Insert(Element el,int placeNr){
if (placeNr<= this.ElementCount()){
int i;
Element el1 = this.first;
Element newElement =new Element();
if ((el1 ==null)||(EilNr == 0)){
newElement = el.Copy();
newElement.next=this.first;
this.first = newElement;
}elsefor (i=1;(el1!=null)||(i<placeNr); i++){
if (i==placeNr){
newElement=el.Copy();
newElement.next=el1.next;
el1.next=newElement;
}
el1 = el1.next;
}
}
}
publicvoid Remove(int placeNr){
if ((placeNr>0)&&(placeNr<= this.ElementCount())){
int i;
if (this.first.next!=null)
{ Element el1 = this.first;
if (placeNr==1){this.first=el1.next;}else{
for (i=2; i<placeNr; i++){
el1 = el1.next;
}
el1.next = el1.next.next;
}
}else{this.first =null;}
}
}
I whant to rewrite theese functions to fit for Doubly Linked List. But i do not know how it to do. I know only that doubly linked list have 2 pointers first and tail or end pointer. Maybe someone have an example or tutorials for theese functions ? I need very very help for this>

