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

前端 未结 7 735
星月不相逢
星月不相逢 2021-01-02 03:27

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?

7条回答
  •  轮回少年
    2021-01-02 04:12

    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.

提交回复
热议问题