Pergunta de entrevista da empresa NVIDIA

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

Respostas da entrevista

Sigiloso

8 de jun. de 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.

Sigiloso

29 de jun. de 2012

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

Sigiloso

15 de set. de 2012

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

Sigiloso

15 de set. de 2012

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