Does set_link_node need to preserve an existing link?


#1

Question

For this exercise, does the implentation of set_link_node() need to check for an existing link before setting a new value?

Answer

NO. The set_link_node() method should not make any attempt to preserve any existing link. That is the responsibility of the data structure which is using the Node class. The method should just overwrite any existing link which exists.