# Trees

> Trees drawn with TikZ's own child syntax: probability trees, search trees, and heaps. 4 examples, rendered, with LaTeX source to copy or open in TeXeR.

A package in the TeXeR TikZ library: https://texer.org/library/trees

Category: Diagrams. On CTAN: https://ctan.org/pkg/pgf

Tags: trees, probability, data structures

## Examples

- [Simple tree](https://texer.org/library/trees/simple-tree.md): A root with two children and four leaves, using TikZ's child syntax with default styling.
- [Probability tree](https://texer.org/library/trees/probability-tree.md): Two stages of events with branch probabilities and the probability of each outcome.
- [Binary search tree with a search path](https://texer.org/library/trees/binary-search-path.md): The nodes visited while searching for 6 are highlighted, along with the edges taken.
- [Binary heap and its array](https://texer.org/library/trees/binary-heap.md): A min-heap drawn as a tree, with the same keys in the array that stores it.
