liveBook · Manning

Traversal

Traversal is the systematic process of visiting elements or nodes in a data structure according to a specified order or rule.

How 5 Manning books explain it

Grokking Data Structures

Array traversal is the process of visiting the elements of an array, typically to inspect or process their values.

How it is used
Applies an operation to every array element and supports scans that find values such as a maximum.
How deep it goes
Works through a Python callback loop and a maximum-index scan, including empty-array handling and initial-value choice.
Examples
Uses printing array elements and scanning die-face counters for the most frequent roll.
What you can do after
Build it from scratch with a Python loop and callback, or adapt the scan to track a largest value and its index.

Read how Grokking Data Structures explains traversal →

Algorithms Every Programmer Should Know

Traversal is the process of visiting the elements of a data structure in sequence to locate or process them.

How it is used
Uses traversal to locate data in linked lists and search nodes in trees.
How deep it goes
Defines linked-list scans from the head, notes their O(N) cost, and contrasts tree searches by depth and layer.
Examples
Traces scanning from a linked-list head and searching for node 8 from tree root 5 with DFS or BFS.
What you can do after
Apply traversal by scanning linked-list nodes from the head or searching tree nodes with BFS or DFS.

Read how Algorithms Every Programmer Should Know explains traversal →

Retrieval Augmented Generation, The Foundational Ideas

Graph traversal is the process of visiting nodes by following edges through a graph from one or more starting points.

How it is used
Supports retrieval by narrowing candidate context through hierarchical descent or graph reachability instead of relying on one similarity search.
How deep it goes
Explains traversal definitions, layer-by-layer scoring, pruning, entry-level control, and graph retrieval roles without detailing full graph construction.
Examples
Uses Finance-versus-HR branch pruning, leaf-specific entry levels, and entity paths such as a marketing director connected to a safety failure.
What you can do after
Apply it via layer-by-layer top-k descent, controlled entry levels, or entity-centered graph paths when broad similarity retrieval misfires.

Read how Retrieval Augmented Generation, The Foundational Ideas explains traversal →

AI-Powered Search

Graph traversal is the process of visiting nodes and relationships in a graph according to a specified path or sequence of steps.

How it is used
Uses search indexes to connect terms, queries, categories, and documents for semantic search and query disambiguation.
How deep it goes
Explains bidirectional index lookups, chained levels, scored edges, and configurable traversal inputs without detailing the scoring implementation.
Examples
Demonstrates skill-to-job paths, disconnected nodes, and server, driver, and chef queries separated by category.
What you can do after
Apply it via SKG traversal to discover related terms, chain graph levels, or disambiguate queries by category.

Read how AI-Powered Search explains traversal →

Optimization Algorithms: AI techniques for design, planning, and control problems

A graph-search technique that explores a tree or graph by visiting nodes according to a specified rule.

How it is used
Uses rule-based exploration to discover paths through trees and graphs in routing, puzzles, mazes, and relationship networks.
How deep it goes
Defines traversal and distinguishes BFS, DFS, DLS, IDS, and bidirectional search, but stops short of route-length optimization.
Examples
Demonstrates traversal through mazes, n-puzzles, family trees, social graphs, and origin-to-destination routing.
What you can do after
Apply BFS, DFS, DLS, IDS, or bidirectional search to find paths through simple, well-defined graph problems.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains traversal →

Also covered in

What to know first

Related concepts

Questions about traversal

What is traversal?

Traversal is the systematic process of visiting elements or nodes in a data structure according to a specified order or rule.

Which Manning books explain traversal?

Grokking Data Structures, Algorithms Every Programmer Should Know, Retrieval Augmented Generation, The Foundational Ideas, AI-Powered Search and Optimization Algorithms: AI techniques for design, planning, and control problems.

What should I know before learning traversal?

Manning books that teach traversal usually introduce graph database, language model, similarity search and node first.

What is the difference between traversal and collapsed tree?

Traversal is the systematic process of visiting elements or nodes in a data structure according to a specified order or rule. Collapsed tree is a retrieval strategy that flattens hierarchical nodes into one index and retrieves across all abstraction levels in a single search.

What kinds of traversal are there?

Kinds of traversal include breadth-first search, recursive traversal, depth-first search, postorder traversal and inorder traversal.

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.