Arrays
Ordered indexable collection for O(1) access by position.
Hierarchical nodes with parent–child links for ordered and nested data.
Swap every node’s two children so the tree becomes its own mirror image.
Walk two trees side by side and report whether they have the same shape and the same values.
Check whether a tree folds onto itself by comparing mirror pairs from the two halves.
Measure heights from the bottom up and check that no node has sides differing by more than one.
Walk the tree level by level and collect the last node of each level, the ones visible from the right.
Read the tree one level at a time, reversing every other level so the values snake down the tree.
Use the fact that an in-order walk of a binary search tree is already sorted, and stop at the kth value.
Let each node report whether it found either target below it, and the first node hearing from both sides wins.
Ordered indexable collection for O(1) access by position.
Nodes linked by pointers — insert and delete without shifting a contiguous block.
Last-in, first-out collection for undo, parsing, and nested work.
First-in, first-out collection for scheduling, BFS, and buffering.
Key-to-value lookup in average O(1) via hashing into buckets.
Priority queue backed by a binary heap for fast min or max access.