Bifalgorithm post · Computer science one · Factory Functions

How should a copied structure avoid sharing references?

How should a copied structure avoid sharing references? (Computer science one · Factory Functions) — "Another common operation is to create a copy of a given s…

Ideas in this flowchart

  • Create a copy of a given structure
  • The given structure serves as the source for the copy.
  • The copy must be a deep copy.
  • The two structures do not share references.
  • Reuse the functionality previously written in the factory.
Feed/

How should a copied structure avoid sharing references?

No cover

Channel

Computer science one

1 page

"Another common operation is to create a copy of a given structure. We will want to again ensure that everything is a deep copy so that the two structures are not sharing references. We can easily do this by reusing the functionality we just wrote in the factory"

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.