liveBook · Manning

Tree

A tree is a connected, acyclic structure of nodes, commonly organized hierarchically through parent-child relationships and optionally around a designated root.

How 11 Manning books explain it

Functional Programming in Scala, Second Edition

A recursive data structure whose values are formed from nodes such as leaves and branches, with this section focusing on structural shape during combination.

How it is used
Models recursive binary data while motivating structural recursion and reusable tree operations.
How deep it goes
Develops implementations for size, maximum, depth, map, and fold through pattern matching and recursive calls.
Examples
Uses node counting, positive-value search, maximum, depth, shape-preserving map, and fold-derived operations.
What you can do after
Build it from scratch by defining a binary Tree and deriving recursive operations or a fold.

Read how Functional Programming in Scala, Second Edition explains tree →

Grokking Algorithms, Second Edition

A tree is a connected graph with no cycles, so no path of edges leads back to an earlier vertex.

How it is used
Organizes directory traversal and motivates specialized trees for searching, compression, and database storage.
How deep it goes
Defines trees as connected acyclic graphs and works through rooted terminology and queue-based traversal.
Examples
Uses a file-directory traversal and searches for 7 and 8 in a binary search tree.
What you can do after
Apply it via Python's os and collections.deque to list files throughout a directory tree.

Read how Grokking Algorithms, Second Edition explains tree →

Object-Oriented Software Design in C++

A hierarchical data structure composed of nodes connected by parent-child relationships without cycles.

How it is used
Organizes hierarchical collections and supports repeated operations over their nodes.
How deep it goes
Defines roots, intermediate nodes, leaves, aggregation, traversal, and Visitor-based operations, but does not formalize tree variants.
Examples
Uses store departments and products plus intramural sports, games, residence halls, and generated reports.
What you can do after
Build it from scratch by modeling nodes, aggregation, traversal, and operations over a hierarchical collection.

Read how Object-Oriented Software Design in C++ explains tree →

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

How it is used
Frames trees as the structure sought when finding a minimum spanning tree for a weighted network.
How deep it goes
Defines trees through unique paths and cycles, then distinguishes connected graphs, spanning trees, and minimum spanning trees.
Examples
Uses a cycle among vertices B, C, and D, then removes the edge between C and D to form a tree.
What you can do after
Understand how removing an edge from a cycle can turn a graph into a tree.

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

Functional Programming in JavaScript

A hierarchical data structure of nodes connected by parent-child relationships with a root.

How it is used
Uses trees to make recursive processing of hierarchical data concrete in JavaScript.
How deep it goes
Defines roots, parents, children, nodes, and recursive mapping with JavaScript classes.
Examples
Uses a mathematician student hierarchy, chained append calls, and recursive name mapping.
What you can do after
Builds a JavaScript tree and recursively transforms every node.

Read how Functional Programming in JavaScript explains tree →

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

A connected acyclic data structure consisting of nodes linked by hierarchical edges.

How it is used
Defines a cycle-free, connected structure within graph theory and blind-search algorithm terminology.
How deep it goes
Provides a concise definition and classification, but stops short of tree operations, traversal algorithms, and complexity analysis.
Examples
Uses NetworkX code for undirected, directed, multigraph, acyclic, and weighted graph examples.
What you can do after
Evaluate whether a graph fits the defining connected, cycle-free, self-loop-free structure of a tree.

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

Grokking Data Structures

A tree is a hierarchical data structure whose elements are connected by parent-child relationships without cycles.

How it is used
Models hierarchical relationships, branching choices, and specialized storage or search structures.
How deep it goes
Defines nodes, subtrees, roots, leaves, branching, and graph properties, then points toward specialized trees without implementation details.
Examples
Uses breakfast choices, hierarchical relationships, linked-list comparisons, and applications including databases, indexing, priority queues, and classification.
What you can do after
Evaluate whether branching relationships call for a tree instead of a linear structure such as a linked list.

Read how Grokking Data Structures explains tree →

Advanced Algorithms and Data Structures

A tree is a hierarchical data structure composed of nodes connected by parent-child relationships without cycles.

How it is used
Uses hierarchical parent-child organization to represent partitions and support dynamic dictionary search.
How deep it goes
Explains parent-pointer representation, recursive root finding, merging, balanced-search assumptions, and traversal costs.
Examples
Uses parent mappings for partitions, a spell-checking dictionary, and a binary search for the missing word “antic.”
What you can do after
Build parent-pointer partitions and implement root finding and merging while estimating tree-height costs.

Read how Advanced Algorithms and Data Structures explains tree →

Software Design for Python Programmers

A tree is a hierarchical data structure composed of nodes connected in parent-child relationships.

How it is used
Organizes hierarchical data for repeated root-to-leaf passes using different algorithms.
How deep it goes
Explains roots, leaves, heterogeneous nodes, aggregation, and traversal, then demonstrates the structure with Python classes.
Examples
Uses store products and intramural sports reports to illustrate roots, departments, sports, games, halls, and leaves.
What you can do after
Apply it via the Visitor Design Pattern to run multiple reports over one hierarchical data collection.

Read how Software Design for Python Programmers explains tree →

Grokking AI Algorithms, Second Edition

A tree is a connected acyclic data structure organized into nodes with a single root and hierarchical parent-child relationships.

How it is used
Represents hierarchical values and search possibilities, especially paths through maze-like problems.
How deep it goes
Defines core terminology and traces BFS traversal, but stops short of formal proofs or broader implementation trade-offs.
Examples
Uses labeled tree diagrams, a maze movement tree, BFS visit sequences, and a Python BFS listing.
What you can do after
Apply it via breadth-first search to generate branches, visit nodes by depth, and reconstruct a path to a goal.

Read how Grokking AI Algorithms, Second Edition explains tree →

100 Java Mistakes and How to Avoid Them

A tree-like data structure organizes elements into parent-child relationships and ordinarily has no cycles.

How it is used
Uses tree traversal to expose when apparently finite recursion becomes infinite.
How deep it goes
Explains recursive traversal and distinguishes legal cycles from construction mistakes, but stops short of implementation code.
Examples
Uses recursive tree traversal and self-referential collection behavior to demonstrate cycle-related failure.
What you can do after
Diagnose traversal failures by checking for cycles and either tracking visited nodes or repairing invalid structure construction.

Read how 100 Java Mistakes and How to Avoid Them explains tree →

Related concepts

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.