int Delete(struct Node *p, int index){ Node *q; int x=-1 , i; if(index < 1 || index >count(p)) return -1; if(index==1){ x=first->data; q=first; first=first->next; delete q; return x; } else{ for(i=0; i<index-1 && p; i++){ q=p; p=p->next; } q->next=p->next; x=p->data; delete p; return x; } }