RingArray is a Swift implementation of a Circular Buffer, but without the wraparound overwriting behavior. That is, if you make a RingArray
with a capacity of 10, and add 11 elements to it, the contents will be transferred to a new, larger buffer, and no data will be lost. This should have approximately the same performance characteristics as any growable array, but with O(1) front-end removals, which is useful for queues of various kinds. The downside is that element contiguity isn't guaranteed.
-
Notifications
You must be signed in to change notification settings - Fork 0
License
arennow/RingArray
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published