liveBook · Manning

Linear search

Linear search is a search technique that examines candidates sequentially until it finds a match or exhausts the collection.

How 7 Manning books explain it

Grokking Data Structures

Linear search examines the elements of a sequence one by one, typically from one end to the other, until the target is found or the sequence is exhausted.

How it is used
Supports searching arrays and linked lists when elements are examined sequentially until a match or endpoint appears.
How deep it goes
Explains scan behavior, sorted-array early termination, linked-list constraints, implementations, and O(n) analysis before contrasting binary search.
Examples
Uses sorted-array searches for targets 8 and 9, plus array and linked-list search implementations.
What you can do after
Build it from scratch by scanning arrays or linked lists, returning a match appropriately, and recognizing O(n) performance.

Read how Grokking Data Structures explains linear search →

Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

A linear search examines elements sequentially in their data-structure order until it finds the sought value or reaches the end.

How it is used
Uses sequential inspection to determine whether a value occurs in an unsorted or otherwise directly traversable collection.
How deep it goes
Defines the scan, implements it for codons and generic Swift collections, and identifies O(n) worst-case work.
Examples
Uses a gene of codons, the target codon ACG, a generic Swift function, and million-element timing exercises.
What you can do after
Build it from scratch for codons or generic Equatable arrays, then compare its timing with binary search.

Read how Classic Computer Science Problems in Swift: Essential techniques for practicing programmers explains linear search →

Clojure: The Essential Reference

A linear search examines collection elements sequentially until a matching element is found or the collection is exhausted.

How it is used
Clarifies how to perform explicit element scans instead of misusing contains? on vectors.
How deep it goes
Defines sequential scanning and contrasts some, .contains, and contains? without developing implementation internals.
Examples
Uses some on a vector, an equality predicate for nil, vector index checks, and Java .contains calls.
What you can do after
Apply it via some or .contains when selecting an explicit element or substring scan.

Read how Clojure: The Essential Reference explains linear search →

Grokking Simplicity

A search algorithm that examines elements sequentially until a matching element is found or the collection is exhausted.

How it is used
Uses sequential array search to separate item lookup from cart operations and expose opportunities for reuse.
How deep it goes
Works through extraction, return values, layer structure, and reuse, then defers a more general loop version.
Examples
Uses shopping-cart lookup, item removal, membership testing, and price updates as concrete search clients.
What you can do after
Apply it via a reusable indexOfItem() function that returns an index or null for cart-based operations.

Read how Grokking Simplicity explains linear search →

Latency

Linear search is a search algorithm that examines elements sequentially until it finds a target or reaches the end of a collection.

How it is used
Uses sequential scanning to find a target in an array and frame runtime growth in algorithmic complexity.
How deep it goes
Defines scanning behavior and average and worst-case O(n), but stops short of detailed implementation analysis.
Examples
Uses array target search, active orders as input-size intuition, and a sequential find function.
What you can do after
Apply it by scanning a collection and estimating average and worst-case search growth.

Read how Latency explains linear search →

High Performance Unity Game Development

A search technique that examines elements sequentially until it finds a match or reaches the end.

How it is used
Handles dictionary hash collisions by locating a free slot during insertion or scanning for a key during lookup.
How deep it goes
Explains insertion and lookup scans and their repeated cost, without detailing implementation code.
Examples
Uses dictionary insertion and lookup after hash collisions to illustrate sequential scans.
What you can do after
Understand how collisions can trigger sequential scans during dictionary insertion and lookup.

Read how High Performance Unity Game Development explains linear search →

Vibe Engineering

Linear search is a search algorithm that examines elements sequentially until a matching element is found or the collection is exhausted.

How it is used
Uses linear search as a performance baseline when evaluating lookup strategies against expected traffic and collection size.
How deep it goes
Compares runtime tradeoffs and stops short of detailing linear-search implementation internals.
Examples
Uses 10,000 accounts, AccountFinder strategies, and JMH comparisons as concrete performance examples.
What you can do after
Evaluate lookup strategies by supplying traffic and data-size assumptions, then verifying claims with benchmarks.

Read how Vibe Engineering explains linear search →

Also covered in

What to know first

Related concepts

Questions about linear search

What is linear search?

Linear search is a search technique that examines candidates sequentially until it finds a match or exhausts the collection.

Which Manning books explain linear search?

Grokking Data Structures, Classic Computer Science Problems in Swift: Essential techniques for practicing programmers, Clojure: The Essential Reference, Grokking Simplicity, Latency, High Performance Unity Game Development and Vibe Engineering.

What should I know before learning linear search?

Manning books that teach linear search usually introduce array, loop, key-value pair and Map first.

What is the difference between linear search and binary search?

Linear search is a search technique that examines candidates sequentially until it finds a match or exhausts the collection. Binary search is an algorithm that repeatedly halves an ordered search interval to locate a target or determine its position or boundary.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.