Exemple #1
0
// deletes a node inside the linked list.
// we assume that, we are not given access to the head of the linked list.
// You only have access to that node.
func DeleteNode(n *datastructures.Node) {
	if n.Next() != nil {
		n.SetValue(n.Next().GetValue())
		n.SetNext(n.Next().Next())
	}
}