Something about tree

Terminologies about tree

height of a node: the longest path from the node to the leaf node
left node or external node: the node that has no child
internal node: the node that has at least one child
height of a tree: the height of the root node of the tree
root node: the topmost node of the tree
depth of a node: the number of edges from the root node to this node
edge: the line connecting nodes
node: an entity that contains key or value and pointers to its child

Type of tree

binary tree
binary search tree
AVL tree
B-tree

Type of binary tree

full binary tree: every node has zero or two child.
perfect binary tree: every internal node has exactly two children and all leaf nodes are in the same level.
complete binary tree: remaining
balanced binary tree: the difference of height of left and right subtree of each node is no more than 1.

posted @ 2024-11-11 17:06  HelenHung  阅读(13)  评论(0)    收藏  举报