Bestbuy 搞的那个Sprint家的学生一年服务免费是不是意思不大?# PDA - 掌中宝
c*5
1 楼
Median of Integer Stream
Given a stream of unsorted integers, find the median element in sorted
order at any given time.
So, we will be receiving a continuous stream of numbers in some random
order and we don’t know the stream length in advance.
Write a function that finds the median of the already received numbers
efficiently at any time. We will be asked to find the median multiple times.
Just to recall, median is the middle element in an odd length sorted array,
and in the even case it’s the average of the middle elements.
Given a stream of unsorted integers, find the median element in sorted
order at any given time.
So, we will be receiving a continuous stream of numbers in some random
order and we don’t know the stream length in advance.
Write a function that finds the median of the already received numbers
efficiently at any time. We will be asked to find the median multiple times.
Just to recall, median is the middle element in an odd length sorted array,
and in the even case it’s the average of the middle elements.