What is the degree of a tree? (As in, a tree ADT)

 ̄綄美尐妖づ 提交于 2020-01-12 07:00:47

问题


I understand that the degree of a node is the number of children it has.

However, how do we define the degree of a tree?


回答1:


Basically The degree of the tree is the total number of it's children i-e the total number nodes that originate from it.The leaf of the tree doesnot have any child so its degree is zero.

The degree of a node is the number of partitions in the subtree which has that node as the root. Nodes with degree=0 are called leaves.




回答2:


In general a graph has a minimum degree and a maximum degree, that is just the minimum respectivly the maximum degree of all nodes in the graph.

If a graph is k-regular, that is all nodes have exactly k neighbours, minimum and maximum degree equal k and the graph is said to be of degree k.

Because a tree is not k-regular you cannot say it has grad k, but you can find its minimum or maximum grad.

Quite common are k-ary trees, that are rooted trees where each node has at most k childs.




回答3:


The degree of a node is the number of its children. The degree of a tree is the maximum degree of any of its nodes.




回答4:


For a rooted tree you might define it as the degree of the root. In some scenarios saying it is the maximum degree of any node in the tree might make sense. But without context it is hard to say what the right definition is. It depends on how you want to use it and what is significant about the "degree" of a tree. If you have a concrete example in mind, or a piece of text that you find puzzling, please update the question.




回答5:


The degree of a graph is 2n

To find the degree of a tree, use the formula for edges of a tree: Edges = (Vertices - 1)

Now apply what we know about the degree of a graph to our number of edges in a tree: Degree of tree = 2(n-1) = 2n-2



来源:https://stackoverflow.com/questions/680041/what-is-the-degree-of-a-tree-as-in-a-tree-adt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!