void insertInmiddle(int d,int p,Nodehead){
if(head==NULL || p==0){
insertAthead(d,head);
return;
}
else if(p>length(head)){
insertAttail(head,d);
}
else{
//take p-1 jumps
int jump=1;
Nodetemp=head;
while(jump<=p-1){
temp=temp->next;
jump++;
}
//create a new node
Node*n =new Node(d)
}
}
IN this insert at middle function why do we keep using new keyword Node(int d) as defined is a parameterised constructor we could have jusst called it .
Why are we using new??