Elements:
Max-heap (smaller half): , root =
Min-heap (larger half): , root =
Median: with elements, median is at position . That's the root of the larger heap: .
If you add : Max-heap: , root =
Min-heap: , root =
Median: average of roots = .
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
See the split
Elements:
Max-heap (smaller half): , root =
Min-heap (larger half): , root =
Median: with elements, median is at position . That's the root of the larger heap: .
If you add : Max-heap: , root =
Min-heap: , root =
Median: average of roots = .