Get the latest tech news
Counted B-Trees (2017)
are one of the best known algorithms around. A full treatment of them is available in any good algorithms book.
They are a means of storing a sorted list of items, in such a way that single-item insertion, deletion and lookup all operate in log(N) time. Finally, a counted B-tree allows you to easily extract order statistics from a changing data set: percentiles and medians. I can't think of any circumstances in which you might want to insert and remove items from a data set while keeping a running track of the median value, but if you need to do it, counted B-trees will let you.
Or read this on Hacker News