You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SortedDictionaryBase<K,V> currently has FindMin/Max() and DeleteMin/Max(). These work on single items, but it would be useful to have range variants to efficiently get multiple items at once.
Solution
Add variants, such as FindMinRange(int numItems) and DeleteMinRange(int numItems).
Describe alternatives you've considered
For DeleteMinRange(), one could call DeleteMin() multiple times. But this is likely is not as efficient as a range implementation which can perform the entire operation at once.
For FindMinRange(), calling FindMin() multiple times wouldn't work. One could workaround this by calling RangeAll() and iterating through that. But that seems roundabout and is not immediately obvious.
There are also the RangeFrom(K bot) and RangeTo(K top), but those don't allow specifying numItems as a parameter.
Additional context
Eventually, these variants could be added to PriorityQueue<T> as well. But implementing it in IntervalHeap<T> will take some effort.
The text was updated successfully, but these errors were encountered:
Description
SortedDictionaryBase<K,V>
currently hasFindMin/Max()
andDeleteMin/Max()
. These work on single items, but it would be useful to have range variants to efficiently get multiple items at once.Solution
Add variants, such as
FindMinRange(int numItems)
andDeleteMinRange(int numItems)
.Describe alternatives you've considered
For
DeleteMinRange()
, one could callDeleteMin()
multiple times. But this is likely is not as efficient as a range implementation which can perform the entire operation at once.For
FindMinRange()
, callingFindMin()
multiple times wouldn't work. One could workaround this by callingRangeAll()
and iterating through that. But that seems roundabout and is not immediately obvious.There are also the
RangeFrom(K bot)
andRangeTo(K top)
, but those don't allow specifyingnumItems
as a parameter.Additional context
Eventually, these variants could be added to
PriorityQueue<T>
as well. But implementing it inIntervalHeap<T>
will take some effort.The text was updated successfully, but these errors were encountered: