Median of Data Stream
Given a stream of numbers, find the median number at any given time (accurate to 1 decimal place).
Example:
1add_number(1)
2add_number(2)
3add_number(3)
4get_median() == 2.0
5add_number(4)
6get_median() == 2.5
You current level isĀ Student
Given a stream of numbers, find the median number at any given time (accurate to 1 decimal place).
Example:
1add_number(1)
2add_number(2)
3add_number(3)
4get_median() == 2.0
5add_number(4)
6get_median() == 2.5
Monster Assistant is thinking...