Array: , alphabet . Root (values 1-9, mid=5): - Bitvector: values get 0, values get 1 - Array: - Bits: - Left gets: - Right gets: Left child (values 1-5, mid=3): - Array: - Bits: - Left: , Right: Continue recursively until each node handles a single value.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/data-structures/wavelet-trees/example-building-step-by-step
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████████████████████████████████████████████████████████████████████████████████████