Skip to content

Eric Liu's Learning Journal

Smarter every day.

Tag: first-element-satisfying-predicate

Binary Search in Go

Binary Search I know, the word binary screams binary tree. But no, binary search doesn’t require a tree at all. It’s usually implemented in an array. In Go, we can simply use a slice to do this. Note that a binary search can only be performed on a sorted array. The generic signature [S ~[]E,… Continue reading Binary Search in Go

Published 17 Oct 2026
Categorized as Software Engineering Tagged binary search, first-element-satisfying-predicate, generic, go, slice
Eric Liu's Learning Journal
Proudly powered by WordPress.