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

前端 未结 7 731
星月不相逢
星月不相逢 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:11

    Degree of a tree is the maximum number of children any node can have. Degree of a tree is predefined so by looking at a tree we can not tell the degree of a tree .

    Let's say we have a tree of degree 3 but every node of the tree has only 0,1 or 2 children. But it does not mean degree of a tree is 2 because we can add 1 more element to any node.

提交回复
热议问题