首页 > 代码库 > 树与二叉树

树与二叉树

  • A tree is a finite nonempty set of elements , it is an abstract model of hierarchical structure. Application:Organization chartsFile systemsProgramming environments 名词解释:Root:根node without parentSiblings:兄弟节点 nodes share the same parentInternal node :内部节点node with at least one childExternal node(leaf):叶节点node without childrenAncestors of a node :祖先节点Descendant of a node :后裔 术语:
    • Depth of a node: number of ancestors
    • Height of a tree: maximum depth of any node
    • Degree of a node: the number of its children
    • Degree of a tree: the maximum number of its node.
    • Subtree: tree consisting of a node and its descendants

树与二叉树