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 - a tree in which each element can have either zero or many children. This structure is link-based.
LinkedBinaryTree - a tree in which each element can have either zero, one or two children. This structure is link-based.
PreorderTreeTraversal - tree traversal algorithm that on each level of a tree visits root before traversing its subtrees.
InorderTreeTraversal - tree traversal algorithm that on each level of a tree visits root after traversing its leftmost subtree.
PostorderTreeTraversal - tree traversal algorithm that on each level of a tree visits root after traversing its subtrees.
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.
Last updated
Was this helpful?