Ask a Question

(reversing a link list) void(struct node**p) {struct node*q,*r; if(*p!=NULL||*p->link!=NULL) {r=q; q=*p; *p=*p->link; } else {q->link=NULL; *p->link=q; } else if(*p==NULL) printf(\"no element\"); else printf(\"1 element so no reversing\"); } } plzzz tell me whether my logic is correct or not

on 2011-08-28 00:31:30   by soumik   on Computer Science & Engineering  0 answers