Think of each value in binary. To find values in a range, you can filter by bit positions.
For alphabet ( bits):
- Values with highest bit 0:
- Values with highest bit 1:
If you're looking for values in , you need some from each group.
The wavelet tree recursively partitions values by their bits. At each level, you split: values with bit 0 go left, values with bit 1 go right. You get a binary tree of depth where each node handles a range of values.