Sollicitatievraag bij Digit Insurance

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

Antwoord op sollicitatievraag

Anoniem

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.