Trees
In computer science, a Tree is a very popular abstract data type (ADT) or a data structure implementing this ADT that simulates a hierarchical Tree structure with a root value and subtrees of the children with a parent node, represented as a set of linked nodes.
A Tree data structure can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the children) with the constraints that no reference is duplicated and none point to the root.
Alternatively, a Tree can be defined abstractly as a whole (globally) as an ordered Tree, with a value assigned to each node. Both these perspectives are useful: while a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access