Sunday, June 12, 2011

Stream and running median

You have a stream of random numbers that are inserted into an expanding array. How can you maintain the current median and what is the complexity.

PS: solved it with two heaps, but not sure whether this is the best approach

No comments:

Post a Comment