---
description: >-
  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.
---

# Trees

Import alias `'ads-js/trees'`

### Table of contents

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

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

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

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

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

[EulerTourTreeTraversal](trees/eulertourtreetraversal) - 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.



