A new data structure for accurate on-line accumulation of rank-based statistics such as quantiles and trimmed means