Skip to content

Instantly share code, notes, and snippets.

@brainwire
Created July 7, 2014 05:52
Show Gist options
  • Save brainwire/2eea37da514967da59a8 to your computer and use it in GitHub Desktop.
Save brainwire/2eea37da514967da59a8 to your computer and use it in GitHub Desktop.
median
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