Pregunta de entrevista de NVIDIA

How to delete a node in a singly linked list without access to the list header.

Respuestas de entrevistas

Anónimo

8 jun 2012

If I understand correctly, singly linked list means access only to the next node. Also You can not access the prev node. Given the situation you can: 1) Switch the CONTENT of the next node to the current. 2) Delete the next node.

Anónimo

29 jun 2012

If the next is NULL, or points to a sentinel node (in case their list uses sentinel for termination)-- then what? =)

Anónimo

15 sept 2012

in that case, memset the contents of the node and mark next pointer of current node as NULL

Anónimo

15 sept 2012

this case can be discussed with the interviewer and it depends a lot on assumptions that u need to negotiate with interviewer