Binary tree
A binary tree is a tree data structure in which each node has at most two children.
Grokking Machine Learning
A tree data structure in which each node has at most two child branches.
- How it is used
- Represents yes-or-no decision processes as branches leading to decisions.
- How deep it goes
- Defines roots, decision nodes, leaves, branches, and tree depth.
- Examples
- Uses rain and temperature questions to decide whether to wear a jacket.
- What you can do after
- Apply branch traversal to follow yes-or-no questions toward a decision.
Grokking Algorithms, Second Edition
A binary tree is a tree in which each node has at most two children.
- How it is used
- Provides the two-child tree structure used to introduce Huffman coding and binary search trees.
- How deep it goes
- Defines the node limit and subtrees, then works through a search-tree example without implementing a general binary tree.
- Examples
- Uses an ancestry chart and a search for 7 in a binary search tree rooted at 10.
- What you can do after
- Evaluate/understand whether a tree meets the two-child limit and why a binary search tree can skip branches during search.
Read how Grokking Algorithms, Second Edition explains binary tree →
Learn C++ by Example
A binary tree is a tree data structure in which each node has at most two child branches.
- How it is used
- Uses binary trees to explain how map searches avoid scanning every stored element.
- How deep it goes
- Explains nodes, child pointers, ordering, balancing, and one search path, but stops short of implementation code.
- Examples
- Uses map pairs {1:a}, {3:c}, and {5:e}, plus a search for {2:b}, to demonstrate insertion and traversal.
- What you can do after
- Evaluate how map ordering and balancing reduce search work compared with linear container scans.
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
A tree data structure in which each node has at most two child nodes.
- How it is used
- Uses binary trees to partition data while training gradient-boosting models.
- How deep it goes
- Explains feature scanning, threshold evaluation, objective scoring, and histogram acceleration, but not complete tree construction.
- Examples
- Demonstrates exhaustive and 256-bin histogram splits on latitude data using Python listings.
- What you can do after
- Diagnose split-search costs and apply histogram-based candidate reduction for large numeric datasets.
Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains binary tree →
Related concepts
- treekind of · A tree is a connected, acyclic structure of nodes, commonly organized hierarchically through parent-child relationships and optionally around a designated root.
- binary search treeincludes · A binary search tree is a binary tree whose nodes follow an ordering relation placing keys in designated left and right subtrees relative to each node.
- heapincludes · A binary heap is an almost complete binary tree in which each parent satisfies an ordering property relative to its children, enabling efficient access to a minimum or maximum element.
- k-d treeincludes · A k-d tree is a binary space-partitioning tree that organizes points in multidimensional space by recursively comparing coordinate dimensions.
- subtreeincludes · A subtree is a tree formed by a node and all its descendants, together with the links connecting them.
- Mapcontrasts with · A map is an associative data structure that stores key-value pairs and supports retrieving values by key.
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.



