You are given a list of numbers that arrive one at a time, forming a data stream. After each number is added to the stream, you must report the median of all numbers seen so far.
Write a function running_median(stream) that returns a list of medians, where the i-th entry is the median of the first i+1 numbers of the stream.
The median of a collection is the middle value when the values are sorted. If the collection has an even number of elements, the median is the average of the two middle values. Return each median as a float. If the input stream is empty, return an empty list.