apple / swift-algorithms

Commonly used sequence and collection algorithms for Swift
Apache License 2.0
5.9k stars 435 forks source link

Add a `merge` algorithm for combining sorted sequences #193

Open mdznr opened 1 year ago

mdznr commented 1 year ago

Description

Adds a simple merge algorithm for combining two sequences that are known to already be sorted by the same criteria

Resolves https://github.com/apple/swift-algorithms/issues/192

Detailed Design

Include any additional information about the design here. At minimum, show any new API:

extension Collection {
    /// The new feature implemented by this pull request.
    func newFeature()
}

Documentation Plan

How has the new feature been documented? Have the relevant portions of the guides been updated in addition to symbol-level documentation?

Test Plan

How is the new feature tested?

Source Impact

This change is purely additive.

Checklist