Skip to content

Glossary: Algorithms Beyond the Basics in Go

Shared array (slices)

Also written: slices share their array

A slice and its copies point at the same underlying array, so a change through one can show up in another. This is why functions can change a caller's slice and why backtracking must save a clone.

Where the book teaches it

Related terms

Copy (of a slice)In place