Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. (25 points) Download the following text file: Median.txt The goal of this problem is to implement the Median Maintenance algorithm (covered in the Week
4. (25 points) Download the following text file: Median.txt The goal of this problem is to implement the "Median Maintenance" algorithm (covered in the Week 3 lecture on heap applications). The text file contains a list of the integers from 1 to 10000 in unsorted order; you should treat this as a stream of numbers, arriving one by one. Letting xi denote the ith number of the file, the kth median mk is defined as the median of the numbers x1,X. (So, if k is odd, then mk is ((k+1)/2)th smallest number among x1,..Xk; if k is even, then mk is the (k/2)th smallest number among X....Xk.) A. (20 points) Please submit the java file: Median_Maintenance.java B. (5 points) In the box below you should type the sum of these 10000 medians, modulo 10000 (i.e., only the last 4 digits). That is, you should compute (mi+m2+m3++m10000)mod10000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started