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
It would be quite useful to have a type that can efficiently store values with corrilative range regions. This type ideally would conform to RangeReplaceableCollection (or near miss). It should store values such that the indicies are sparse and there is a way to test if it contains and index. (Example posted with a name just for illustration).
structRegionList<Element,Index>{structRegion:RandomAccessCollection{// a contiguous region of elements from startIndex to endIndex // Element = SpareArray.Element// Index = RegionList.Index}structRegionView:RandomAccessCollection{typealiasElement=RegiontypealiasIndex=Int}varregions:RegionView{get}}extensionRegionList:RangeReplaceableCollection{}
As the count of items increases the storage should increase as a constant scale factor accordingly O(space N) = k*N + c.
As the count of items increases the access time per index should remain constant O(access N) = c.
As the delta between the start index and end index increases the storage should only crease as a the count of items increases. e.g. the memory usage from a region list with a start index of 0 and end index of 100 with 2 elements in it should be the same as one with a start index of 0 and an end index of 100000 with 2 elements in it.
Testing if an index is not contained within the indicies should be at most amortized constant time.
The text was updated successfully, but these errors were encountered:
It would be quite useful to have a type that can efficiently store values with corrilative range regions. This type ideally would conform to RangeReplaceableCollection (or near miss). It should store values such that the indicies are sparse and there is a way to test if it contains and index. (Example posted with a name just for illustration).
Example usage:
As the count of items increases the storage should increase as a constant scale factor accordingly
O(space N) = k*N + c
.As the count of items increases the access time per index should remain constant
O(access N) = c
.As the delta between the start index and end index increases the storage should only crease as a the count of items increases. e.g. the memory usage from a region list with a start index of 0 and end index of 100 with 2 elements in it should be the same as one with a start index of 0 and an end index of 100000 with 2 elements in it.
Testing if an index is not contained within the indicies should be at most amortized constant time.
The text was updated successfully, but these errors were encountered: