Skip to content

Instantly share code, notes, and snippets.

ashelly / mediator.c
Created May 28, 2013
Running Median. Finds the median of the last K inputs in O(lg K). See for some details.
View mediator.c
//Copyright (c) 2011 under <>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t
staltz /
Last active Oct 24, 2021
The introduction to Reactive Programming you've been missing