Skip to content

Glossary: Data Structures and Algorithms in Go

Integer division

Also written: / on ints, %

Dividing two whole numbers with `/` drops the remainder (`7 / 2` is `3`), and `%` gives the remainder. It is used to find a slice's middle index with `len(items) / 2` and to turn minutes into hours.

Where the book teaches it

Related terms

Binary searchMerge sort