Median def. inaccurate


  • 0
    R

    Technical correctness is the best type of correctness.

    a sample illustrates that [1,2,3,4] ought to yield 2.5.
    However, the STATISTICAL DEFINITION of median is the DATA POINT which seperates the upper half from the lower half. By definition, the median MUST be a member of the data set.

    Bad question.


  • 1
    G

    As described in wikipedia, it is a common approch to take the mean of the 2 middle numbers when there is an even amount of observations: https://en.wikipedia.org/wiki/Median#Basic_procedure


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.