Pergunta de entrevista da empresa Digit Insurance

Q) How would you write code to reverse a linked list

Resposta da entrevista

Sigiloso

24 de nov. de 2020

This was a bit tricky. I explained to the interviewer my visualisation of the linked list and worked my way through the process. Something like: curr = head; while(curr!=NULL){ next=curr->next; curr->next=prev; curr=next } finally, i think i missed assigning the head value as prev at the end.