Frage im Vorstellungsgespräch bei Digit Insurance

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

Antwort im Vorstellungsgespräch

Anonym

24. Nov. 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.