I have a collection of items, and every item is a simple object with several fields.
List<MyObject>
where
MyObject = {
long value1,
long value2
}
I need collection to be sorted by value1, for instance. Quite often I need to retrieve, for instance, 20 "top" records. New items are added very frequently (hundreds times per second) and may contain e.g. 50000 items.
What types of collection I might use to achieve very fast update of an ordered list?