Skip to content
UPEEC

Trees

Hierarchical structures of nodes with parent–child relationships.

Easy
Comments 0

A tree has one root; each node has children; nodes without children are leaves. The height is the longest root-to-leaf path. Trees model file systems, HTML documents, decision logic and — like this library — topics and sub-topics.

Sub-topics (3)

Binary Trees

Each node has at most two children; traversed in-order, pre-order, post-order or level-order.

Easy♥ 0🔖 0💬 0

Binary Search Trees

Left subtree smaller, right subtree larger — search, insert and delete in O(log n) when balanced.

Intermediate♥ 0🔖 0💬 0

Heaps

A complete binary tree where each parent is ≤ (min-heap) or ≥ (max-heap) its children.

Intermediate♥ 0🔖 0💬 0

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.