> For the complete documentation index, see [llms.txt](https://alex-myznikov.gitbook.io/adsjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alex-myznikov.gitbook.io/adsjs/api/trees.md).

# Trees

Hierarchical data structures with one root element having zero to many children each of those itself can be treated as a root of a subtree.

Import alias `'ads-js/trees'`

### Table of contents

[GeneralTree](/adsjs/api/trees/generaltree.md) - a tree in which each element can have either zero or many children. This structure is link-based.

[LinkedBinaryTree](/adsjs/api/trees/linkedbinarytree.md) - a tree in which each element can have either zero, one or two children. This structure is link-based.

[PreorderTreeTraversal](/adsjs/api/trees/preordertreetraversal.md) - tree traversal algorithm that on each level of a tree visits root before traversing its subtrees.&#x20;

[InorderTreeTraversal](/adsjs/api/trees/inordertreetraversal.md) - tree traversal algorithm that on each level of a tree visits root after traversing its leftmost subtree.&#x20;

[PostorderTreeTraversal](/adsjs/api/trees/postordertreetraversal.md) - tree traversal algorithm that on each level of a tree visits root after traversing its subtrees.

[EulerTourTreeTraversal](/adsjs/api/trees/eulertourtreetraversal.md) - tree traversal algorithm which walks around the tree in a 'bound-to-left' manner and visits each element 2 (pre and post) times for general and 3 (pre, in and post) times for binary trees.
