2013/02/26

Calculate The Median Using Only Counters

Construct an algorithmic program to determine the normal of a do of integers.

You are given:
The number of integers in the even out (which may be even or odd).
The range of the integers (from 0 to 2^12 - 1)
Counter 1, which counts all determine = an integer enclosure value you set
(The limit values can be different on the 2 counters.)

You can stream the faultless set of integers past the counters whatsoever number of propagation
(although, obviously, fewer times is better). After each streaming, you can read
the counter values and determine the limit values. One streaming will increment the
values in both counters.

You cannot:
* Change any values in the stream (e.g., to sort the numbers)
* Stream only part of the set past the counters.
* Determine the index in the stream of any particular value.
* Read the values off the stream into stock and manipulate them there.

Each time you stream the integers past the counters takes 5 milliseconds. An
excellent solution will take less than atomic number 6 milliseconds to compute. An
acceptable solution can take up to two hundred milliseconds.

Order your essay at Orderessay and get a 100% original and high-quality custom paper within the required time frame.



For your testing, consider the following abbreviated data sets with a sample
size of 8 and range of values from 0 to 7:

strain 162275165
precedent 247332161
experiment 352724172
try 416656327
essay 572766625
Sample 610265437
Sample 700000000
Sample 811111111
Sample 944444444
Sample 1027722772

Your algorithm must correctly calculate the median value value. If the sample size
is odd, the median is the (N/2 + 1)th element (if the sequence were sorted).
If the sample size is even, the median is defined as the AVERAGE of the
N/2 and N/2 + 1 element.

No, this isnt a homework problem. We have a custom piece of hardware that
can stream a data set past the 2 counters. We need to be able to calculate
the median of this data set.If you want to get a full essay, order it on our website: Orderessay



If you want to get a full essay, wisit our page: write my essay .

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.