Question: The following lab problem can be solved using priority queue efficiently. Problem: In this problem you want to read in a list of integer values.
The following lab problem can be solved using priority queue efficiently.
Problem:
In this problem you want to read in a list of integer values. After reading in each value
print the median of the list so far. There can be up to values.
What is Median?
Median can be defined as the element in the data set which separates the higher half of the
data sample from the lower half. When the input size is odd, we take the middle element of
sorted data as the median. If the input size is even, we pick an average of middle two
elements in the sorted stream as the median.
Sample InputOutput :
Input: this number represents how many inputs
Output:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
