sepknow
asked on
Find median from array of double with given range.
Given an array [1..1000] of double.
Given a range of say 120..820.
How do I find the median value from the given range with Delphi 6?
(Free component recommendation is acceptable).
Given a range of say 120..820.
How do I find the median value from the given range with Delphi 6?
(Free component recommendation is acceptable).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.purplemath.com/modules/meanmode.htm
However, to answer your question more directly, the median value is the middle one, so all you need to do is find the ones that are #500 and #501 in the list when it is sorted (either in ascending or descending order). If those are the same, then that is the median (or middle) value. If those two are different, then the usual custom is to use the average of the two [i.e. (V500 + V501) / 2 ].