Akamai Interview Question

How to remove a element from a single linked list a 3rd element when only the reference of it is given.

Interview Answers

Anonymous

Jul 12, 2011

void removeElement(node n) { n.data = n.next.data; n.next=n.next.next; }

5

Anonymous

Sep 7, 2010

As you cant traversce in linked list back so we have to copy the content of next value in list to the current node(node to be removed)

1