Question: In data smoothing application, such as in visualizing trends in stock averages over time, it is useful to keep track of the median of a

In data smoothing application, such as in visualizing trends in stock averages over time, it is useful to keep track of the median of a set, S, of numbers as values are inserted or removed from S. Describe a method for maintaining the median of an initially empty set, S, subject to an operation, inser x), which inserts the value x, and an operation, median O. which returns the median in S. Each of these methods should run in at most O (log n) time, where n is the number of values in S
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
