Implemented the median mantenace algorithm using Heaps