You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because a "list" is just the head link of a chain, the clone method currently clones only the head link. The new head link references the same second link as the original list and so, for example, appending to either list affects both. To avoid the ugly side effects that this can produce, LinkedListLike should implement clone() to perform a deep clone of all of the nodes on the list.
The text was updated successfully, but these errors were encountered:
Because a "list" is just the head link of a chain, the clone method currently clones only the head link. The new head link references the same second link as the original list and so, for example, appending to either list affects both. To avoid the ugly side effects that this can produce, LinkedListLike should implement clone() to perform a deep clone of all of the nodes on the list.
The text was updated successfully, but these errors were encountered: