Beispiel #1
0
func DeleteNode(n *linkedlist.Node) {
	if n.Next != nil {
		n.Value = n.Next.Value
		n.Next = n.Next.Next
	}
	// This doesn't 'delete' node but
	// rather modifies its value to that of the
	// node in front of it, and deletes it.
	// Using this method we cannot delete
	// the node at the front of a singly linked list.
}