thomas
BAN USERAre the random numbers drawn from the range 1 to 100?
In this case you can use a bit vector of length 100. Set all bits to 0. Iterate over the input: for every number i in the input set bits[i] to 1. Then iterate over the bits to find the missing numbers. Their bits are still 0.
from Martin Fowler . com:
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.
Here is an idea to find the median value:
* find the global min and max
* set up bins between min and max
* find the bin b containing the median by collecting number of elements per bin
* select candidate c for median from elements of b
* test if c is the median by collecting number of elements <= c and number of elements > c
* if c is not median, divide b further and repeat procedure
* if c is median, return c
update:
* compute the mean and the standard deviation of all elements
* find the median in the interval (mean - std, mean + std) by binning and counting the total number of elements in each bin
- thomas January 27, 2011