swift-collections icon indicating copy to clipboard operation
swift-collections copied to clipboard

Commonly used data structures for Swift

Results 70 swift-collections issues
Sort by recently updated
recently updated
newest added

This is a major go to in [Java](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ConcurrentHashMap.html) and it would be nice to have something similar here. It's safe to assume this would be for the distant future after...

enhancement

Duplicate initializers for `OrderedDictionary` cause ambiguity in the compiler when it tries to resolve an initializer, however only under certain circumstances. I'm not 100% certain about what the scope of...

bug

Adds two methods to change either the minimum or maximum element of a `Heap` instance. If the value changes enough that the previous second-place element now surpasses it, that former...

#113 fixed a performance issue with `Deque`'s storage allocation, but it did not add tests to cover this area. Add some!

enhancement
Deque

At this moment, no collection can address random insertions. I have a data structure implemented through implicit Treap that behaves like a general array but can do random insertions/deletions/access with...

enhancement

Implement initialiser of Deque to allow initialisation of Deque elements like available for Array(repeating: 0.0, count: 10). The repeating parameter shall be setable to any Double for a number of...

enhancement
Deque

Currently the `Heap` tests in [./Tests/PriorityQueueTests/HeapTests.swift](https://github.com/apple/swift-collections/blob/main/Tests/PriorityQueueTests/HeapTests.swift) are relying on `@testable import` to access internal interfaces. Unfortantely this doesn't work in release mode, so we can only run heap tests in...

bug
good first issue
Heap

This request expands on `Sequence` support for `Heap`s. - To match the ordered views, the property for the unordered view has a type-alias. - The ordered views fully implement `underestimatedCount`....

Hello everyone, I'd like to suggest adding an ordered collection similar to Swift's `Array`, but with stable indices. ## What am I suggesting? Like many collections, `Array` stores elements in...

enhancement

### Description Adds a sparse set data structure as suggested in issue [#24](https://github.com/apple/swift-collections/issues/24) ### Detailed Design A sparse set is a data structure which represents a set of non-negative integers....