Skip to content

Eric Liu's Learning Journal

Smarter every day.

Tag: memory leak

Stack & Queue in Go

1. Stack This is your good ol’ LIFO (last-in, first-out) structure. Just imagine a Pringles tube. A basic stack should have the following methods: In Go, you can use a slice as the underlying data structure. Notice how initiating the store slice in the NewStack[T any]() constructor is optional? This is because we have enough… Continue reading Stack & Queue in Go

Published 15 Oct 2026
Categorized as Software Engineering Tagged generic, go, memory leak, queue, slice, stack
Eric Liu's Learning Journal
Proudly powered by WordPress.