Created
July 7, 2014 05:52
-
-
Save brainwire/2eea37da514967da59a8 to your computer and use it in GitHub Desktop.
median
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum += value | |
count ++ | |
delta = sum / count / count // delta = average/count | |
if value < median { | |
median -= delta | |
} else { | |
median += delta | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment