Binary tree -- Wikipeida
In computer science,
a binary tree is a tree data structure in which each node has at most two children,
which are referred to as the left child and the right child.
A recursive definition using just set theory notions
is that a (non-empty) binary tree is a tuple (L, S, R),
where L and R are binary trees or the empty set and S
is a singleton set containing the root.
Some authors allow the binary tree to be the empty set as well.
From a graph theory perspective,
binary (and K-ary) trees as defined here are arborescences.
A binary tree may thus be also called a bifurcating arborescence-a term
which appears in some very old programming books,
before the modern computer science terminology prevailed.
It is also possible to interpret a binary tree as an undirected,
rather than a directed graph, in which case a binary tree is an ordered, rooted tree.
Some authors use rooted binary tree instead of binary tree to emphasize the fact
that the tree is rooted, but as defined above,
a binary tree is always rooted.
A binary tree is a special case of an ordered K-ary tree, where K is 2.
In mathematics, what is termed binary tree can vary significantly from author to author.
Some use the definition commonly used in computer science,
but others define it as every non-leaf having exactly two children
and don't necessarily order (as left/right) the children either.
In computing, binary trees are used in two very different ways:
First, as a means of accessing nodes based on some value or label associated with each node.
Binary trees labelled this way are used to implement binary search trees and binary heaps,
and are used for efficient searching and sorting.
The designation of non-root nodes as left or right child
even when there is only one child present matters in some of these applications,
in particular, it is significant in binary search trees.
However, the arrangement of particular nodes into the tree
is not part of the conceptual information.
For example,
in a normal binary search tree the placement of nodes depends almost entirely on the order
in which they were added,
and can be re-arranged (for example by balancing) without changing the meaning.
Second, as a representation of data with a relevant bifurcating structure.
In such cases,
the particular arrangement of nodes under and/or to the left or right of other nodes
is part of the information (that is, changing it would change the meaning).
Common examples occur with Huffman coding and cladograms.
The everyday division of documents into chapters, sections, paragraphs,
and so on is an analogous example with n-ary rather than binary trees.
a binary tree is a tree data structure in which each node has at most two children,
which are referred to as the left child and the right child.
A recursive definition using just set theory notions
is that a (non-empty) binary tree is a tuple (L, S, R),
where L and R are binary trees or the empty set and S
is a singleton set containing the root.
Some authors allow the binary tree to be the empty set as well.
From a graph theory perspective,
binary (and K-ary) trees as defined here are arborescences.
A binary tree may thus be also called a bifurcating arborescence-a term
which appears in some very old programming books,
before the modern computer science terminology prevailed.
It is also possible to interpret a binary tree as an undirected,
rather than a directed graph, in which case a binary tree is an ordered, rooted tree.
Some authors use rooted binary tree instead of binary tree to emphasize the fact
that the tree is rooted, but as defined above,
a binary tree is always rooted.
A binary tree is a special case of an ordered K-ary tree, where K is 2.
In mathematics, what is termed binary tree can vary significantly from author to author.
Some use the definition commonly used in computer science,
but others define it as every non-leaf having exactly two children
and don't necessarily order (as left/right) the children either.
In computing, binary trees are used in two very different ways:
First, as a means of accessing nodes based on some value or label associated with each node.
Binary trees labelled this way are used to implement binary search trees and binary heaps,
and are used for efficient searching and sorting.
The designation of non-root nodes as left or right child
even when there is only one child present matters in some of these applications,
in particular, it is significant in binary search trees.
However, the arrangement of particular nodes into the tree
is not part of the conceptual information.
For example,
in a normal binary search tree the placement of nodes depends almost entirely on the order
in which they were added,
and can be re-arranged (for example by balancing) without changing the meaning.
Second, as a representation of data with a relevant bifurcating structure.
In such cases,
the particular arrangement of nodes under and/or to the left or right of other nodes
is part of the information (that is, changing it would change the meaning).
Common examples occur with Huffman coding and cladograms.
The everyday division of documents into chapters, sections, paragraphs,
and so on is an analogous example with n-ary rather than binary trees.
上一篇:文爱【短语】
下一篇:谁先碰的瓷1
声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。
文章熱度:★★★☆☆
文章難度:★★☆☆☆
文章質量:★★★☆☆
說明:系統根據文章的熱度、難度、質量自動認證,已認證的文章將參與打字排名!
本文打字排名TOP20
- 1格物致知 08-14 14:37461 KPM
- 2游客18548988... 08-14 21:28427 KPM
- 3babobi 08-17 08:33413 KPM
- 4龟速打字光速... 08-14 08:35401 KPM
- 5Helloregina 08-16 08:27393 KPM
- 6StephenCha... 02-10 20:57390 KPM
- 7bczhc 02-02 10:12377 KPM
- 8aowoe 08-27 10:25377 KPM
- 9游客18161856... 08-22 15:08371 KPM
- 10苍后翼 08-13 14:07370 KPM
- 11我家小狗会打... 08-16 07:35364 KPM
- 12游客15572135... 08-11 19:49362 KPM
- 13大果豆 08-18 21:06361 KPM
- 14游客18885561... 02-08 15:49357 KPM
- 15泡泡茶壶ll 08-20 22:20354 KPM
- 16游客18728332... 02-03 16:38354 KPM
- 17游客19890030... 08-06 21:05353 KPM
- 18偶得米果 02-02 13:32348 KPM
- 19游客18422319... 08-22 21:21347 KPM
- 20游客15155764... 08-28 18:51347 KPM
用户更多文章推荐
- 中国邮递员问题 -- Wikipedia2024-02-19
- 旅行推销员问题 -- 维基百科2024-01-30
- 巡洋护卫舰 —— 维基百科2024-01-04
- 罗马帝国 —— 维基百科2023-06-27
- Roman Empire -- Wikipedia2023-06-27
- Crested goshawk -- Wikipedia2023-06-21
- 天秤座——维基百科2023-02-11
- 天坛座——维基百科2023-02-11
- 平面设计——维基百科2023-02-11
- 台州学院——维基百科2023-02-02
- Integral -- Wikipedia2023-02-01
- Traffic light -- Wikipedia2022-12-10
- Turochamp -- Wikipedia2022-12-08
- Windows 2.1x -- Wikipedia2022-10-16
- 事件驱动程序设计——维基百科2022-07-31
- Pyramid of Khentkaus I -- Wiki2022-07-29
- Messinian salinity crisis-WIki2022-05-14
- 汇丰银行公馆旧址——维基百科2022-03-27
- Mathematical problem-Wikipedia2022-03-27
- SCOTUS - wikipedia2022-03-27