[树] 定义&概念

定义&概念

定义

  • 根节点唯一
  • 子树不相交
  • recursive data structure

参数

  • 树的度

  • 层次:
  • 深度:Depth of x

    Length of path from root to x
    or
    No. of edges in path from root to n

  • 高度:Height of x

    No. of edges in longest path form x to a leaf
    8和11 leaf元素高度相同

  • 树的高度:Height of root node
  • 有序&无序

关系

  • Child
  • Parent
  • Sibling
  • ancestor
  • descendent
  • cousin
posted @ 2022-06-23 21:16  deadright  阅读(32)  评论(0)    收藏  举报