collection
collection copied to clipboard
Add efficient range methods to SplayTreeMap
SplayTreeMap
is very useful for managing time series and other sorted data. A common use case involves looking at a range (imagine zooming into a small area of a large chart) efficiently, but the current implementation does not offer methods to do that.
The existing lastKeyBefore
and firstKeyAfter
methods are not very useful if it's not possible to use them to do tree.subtree(firstKeyAfter(x), lastKeyBefore(y))
.
Can we please add such a range method to SplayTreeMap
?
Examples in other languages:
cc @lrhn
I have pushed a proposal: https://dart-review.googlesource.com/c/sdk/+/144765