mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
2.0 KiB
2.0 KiB
Collections
Swift Collections is an open-source package of data structure implementations for the Swift programming language.
Overview
Additional Resources
Modules
- Basic Containers -
RigidArray, a fixed capacity and no implicit resizing dynamic non-copyable array capable of storing non-copyable elements.UniqueArray, an implicitly resizable dynamic non-copyable array capable of storing non-copyable elements. - Bit Collections -
BitSetandBitArray, dynamic bit collections. - Deque Module -
Deque<Element>, a double-ended queue backed by a ring buffer. Deques are range-replaceable, mutable, random-access collections. - Heap Module -
Heap, a min-max heap backed by an array, suitable for use as a priority queue. - Ordered Collections -
OrderedSet<Element>, a variant of the standardSetwhere the order of items is well-defined and items can be arbitrarily reordered. Uses aContiguousArrayas its backing store, augmented by a separate hash table of bit packed offsets into it.OrderedDictionary<Key, Value>, an ordered variant of the standardDictionary, providing similar benefits. - Hash Tree Collections -
TreeSetandTreeDictionary, persistent hashed collections implementing Compressed Hash-Array Mapped Prefix Trees (CHAMP). These work similar to the standardSetandDictionary, but they excel at use cases that mutate shared copies, offering dramatic memory savings and radical time improvements.