Update Tree image.

This commit is contained in:
Oleksii Trekhleb
2022-07-27 18:25:52 +02:00
parent ceb6c858c7
commit b7017ede98
4 changed files with 19 additions and 13 deletions

View File

@@ -10,24 +10,26 @@ _Read this in other languages:_
* [Segment Tree](segment-tree) - with min/max/sum range queries examples
* [Fenwick Tree](fenwick-tree) (Binary Indexed Tree)
In computer science, a **tree** is a widely used abstract data
type (ADT) — or data structure implementing this ADT—that
simulates a hierarchical tree structure, with a root value
and subtrees of children with a parent node, represented as
In computer science, a **tree** is a widely used abstract data
type (ADT) — or data structure implementing this ADT—that
simulates a hierarchical tree structure, with a root value
and subtrees of 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
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
points to the root.
A simple unordered tree; in this diagram, the node labeled 7 has
two children, labeled 2 and 6, and one parent, labeled 2. The
root node, at the top, has no parent.
![Tree](https://upload.wikimedia.org/wikipedia/commons/f/f7/Binary_tree.svg)
![Tree](./images/tree.jpeg)
*Made with [okso.app](https://okso.app)*
## References