# median

(definition)

**Definition:**
The value which has an equal number of values greater and less than it. For an even number of values, it is the *mean* of the two middle values.

**See also**
*mean*, *mode*, *midrange*, *Select*, *select and partition*.

*Note:
The median is the "middle" value. The median of 1, 1, 3, 50, and 60 is 3 since two elements (1 and 1) are less than it and two elements (50 and 60) are greater. The median of 1, 1, 2, 3, 3, and 4 is 2.5, the mean of 2 and 3.*

Author: PEB

## Implementation

select kth element (Pascal and C++)

Go to the
Dictionary of Algorithms and Data
Structures home page.

If you have suggestions, corrections, or comments, please get in touch
with
Paul E. Black.

Entry modified 16 November 2009.

HTML page formatted Tue Dec 6 16:16:32 2011.

Cite this as:

Paul E. Black, "median", in
*Dictionary of Algorithms and Data
Structures* [online], Paul E. Black, ed.,
U.S. National Institute of
Standards and Technology. 16 November 2009. (accessed TODAY)
Available from: http://www.nist.gov/dads/HTML/median.html