MedianMaintenance: begin implementation using hash table