struct Node * deleteFromLast(struct Node *s){ struct Node *t,*p; t=s; while(t->next != s){ p=t; t=t->next; } s->pre=p; p->next=s; t->next=NULL; t->pre=NULL; free(t); return s; }