Summary
A
tree is a hierarchical structure of
nodes connected by
edges. The top is the
root. A
parent links to its
children. A
leaf has no children.
depth counts steps from the root.
height is the longest path down. A
subtree is any node with its descendants. A
binary_tree has up to two children. A
binary_search_tree keeps left keys smaller and right keys larger. Common
traversals:
preorder,
inorder,
postorder, and
bfs/
dfs.