Interview Question

Software Engineer Interview(Student Candidate) New York, NY

How would you remove a node from a list with only a pointer

  to the node itself?
Tags:
algorithm
Answer

Interview Answer

1 Answer

2

Copy the value of the next node in this node and have it point to next->next, in effect deleting the "next" node instead.

Interview Candidate on Nov 11, 2012

Add Answers or Comments

To comment on this question, Sign In with Facebook or Sign Up