Trees

Hierarchical nodes with parent–child links for ordered and nested data.

Related concepts

TopicDescription
Depth-First SearchExplore as far as possible down one path before backtracking, used to walk trees, graphs, and grids.
Breadth-First SearchExplore level by level from a starting point, the go-to way to find the shortest path in an unweighted graph.
RecursionSolve a problem by having a function call itself on a smaller version of the same problem until it hits a base case.
ArraysOrdered indexable collection for O(1) access by position.
Linked ListsNodes linked by pointers — insert and delete without shifting a contiguous block.
StacksLast-in, first-out collection for undo, parsing, and nested work.