dray92

dray92 / GetMedian / 0.1.0

README.md

Getting the median is a pretty basic and frequent requirement. It can be a pretty expensive operation, especially in the case where numbers are constantly being added and medians are regularly required, including between successive add operations. It does not make sense to constantly sort the 'entire' data structure after every insertion or on every call to get a median. This algorithm tries to find the best mid-ground to achieve this.

"Finds the median of a space-delimited integer stream. Median call should work regardless of it being called after insertion of a subset of the full list."