Domanda di colloquio di Microsoft

Remove a node from Linked list when address of same node is given

Risposte di colloquio

Anonimo

21 feb 2015

public void deleteValue(double d) { Link current = first; Link previous = first; while(current != null) { if(current.dData == d) { previous.next = current.next; break; } previous = current; current = current.next; } if(current == null) { System.out.println("Value = " +d+ " not found"); } }

Anonimo

2 mag 2015

copy data and next pointer from the next node to current node