Skip to content

Glossary: Coding Interviews in Go

Stack

Also written: pattern 4

A last-in, first-out collection used for 'most recent', 'undo' and 'cancel out' problems. In Go it is a slice where `append` pushes and `stack[:len(stack)-1]` pops.

Where the book teaches it

Related terms

Monotonic stackQueue