Pergunta de entrevista da empresa Meta

reserve linked list

Resposta da entrevista

Sigiloso

22 de abr. de 2012

void reverse() { node* a=head; if(a==NULL) return; node *b=a->next; if(b==NULL) return; node *c=b->next; while(b!=NULL) { b->next=a; a=b; b=c; if(c!=NULL) c=c->next; } head->next=NULL; head=a; }

1