Skip to content

Glossary: Algorithms Beyond the Basics in Go

Copy (of a slice)

Also written: slices.Clone, Clone

`slices.Clone(chosen)` makes a new slice with the same items in a new array. Later changes to the original don't touch it, which is why backtracking saves a copy.

Where the book teaches it

Related terms

Backtrackingslices.SortFuncShared array (slices)