tree
A hierarchy of nodes joined by edges, with one root at the top, no cycles, and exactly one path between any two nodes.
In more detail
Every node except the root has exactly one parent, so a tree with n nodes has n minus one edges. Trees model folders, organisation charts, parsed expressions and search indexes. A spanning tree is a tree drawn from the edges of a graph.
Related terms
- binary tree — A tree in which every node has at most two children, called the left child and the right child.
- root — The single node at the top of a tree, the only one with no parent.
- leaf — A tree node with no children, at the bottom of a branch.
- height — The number of edges on the longest path from a tree's root down to a leaf; a node's depth is its number of edges from the root.
- subtree — A node together with everything below it, which is itself a tree.
Taught in
- Searching With Hashes Versus Trees — Algorithms & Data Structures for Working Engineers
- Binary Trees And Their Traversals — Algorithms & Data Structures for Working Engineers
- Binary Search Trees: Search, Insert And Delete — Algorithms & Data Structures for Working Engineers
- Divide And Conquer And The Recurrence — Algorithms & Data Structures for Working Engineers
- Greedy Algorithms: When Local Is Global — Algorithms & Data Structures for Working Engineers
- Backtracking: Search With Pruning — Algorithms & Data Structures for Working Engineers