This is a translation of the following article. Thanks [@Evgeny Shvarov] for the help in translation.
This post is also available on Habrahabrru.
The post was inspired by this Habrahabr article: Interval-associative arrayru→en.
Since the original implementation relies on Python slices, the Caché public may find the following article useful: Everything you wanted to know about slicesru→en.
Note: Please note that the exact functional equivalent of Python slices has never been implemented in Caché, since this functionality has never been required.
And, of course, some theory: Interval treeru→en.
All right, let’s cut to the chase and take a look at some examples.