From 0205c041c98e26176fc3b2c2ce1a6c36553e803d Mon Sep 17 00:00:00 2001 From: Pranav Kasetti Date: Mon, 19 Apr 2021 08:21:23 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Add=20new=20heading=20and=20description=20f?= =?UTF-8?q?or=20partitionIndex=20=F0=9F=A4=B7=E2=80=8D=E2=99=82=EF=B8=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 410a5310..5b3ff87e 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,10 @@ Read more about the package, and the intent behind it, in the [announcement on s - [`split(maxSplits:omittingEmptySubsequences:whereSeparator)`, `split(separator:maxSplits:omittingEmptySubsequences)`](https://github.com/apple/swift-algorithms/blob/main/Guides/LazySplit.md): Lazy versions of the Standard Library's eager operations that split sequences and collections into subsequences separated by the specified separator element. - [`windows(ofCount:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Windows.md): Breaks a collection into overlapping subsequences where elements are slices from the original collection. +#### Binary Search Partitions + +- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md)`: Splits a collection into two partitions according to a predicate and returns the index of the partition. + ## Adding Swift Algorithms as a Dependency To use the `Algorithms` library in a SwiftPM project, From ebd510b529fce07854c31448e3f01ff0a3779e25 Mon Sep 17 00:00:00 2001 From: Pranav Kasetti Date: Thu, 22 Apr 2021 11:59:37 +0100 Subject: [PATCH 2/4] Move into Other useful ops. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b3ff87e..67b12337 100644 --- a/README.md +++ b/README.md @@ -43,14 +43,11 @@ Read more about the package, and the intent behind it, in the [announcement on s - [`firstNonNil(_:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/FirstNonNil.md): Returns the first non-`nil` result from transforming a sequence's elements. - [`indexed()`](https://github.com/apple/swift-algorithms/blob/main/Guides/Indexed.md): Iterate over tuples of a collection's indices and elements. - [`interspersed(with:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Intersperse.md): Place a value between every two elements of a sequence. +- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md)`: Splits a collection into two partitions according to a predicate and returns the index of the partition. - [`reductions(_:)`, `reductions(_:_:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Reductions.md): Returns all the intermediate states of reducing the elements of a sequence or collection. - [`split(maxSplits:omittingEmptySubsequences:whereSeparator)`, `split(separator:maxSplits:omittingEmptySubsequences)`](https://github.com/apple/swift-algorithms/blob/main/Guides/LazySplit.md): Lazy versions of the Standard Library's eager operations that split sequences and collections into subsequences separated by the specified separator element. - [`windows(ofCount:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Windows.md): Breaks a collection into overlapping subsequences where elements are slices from the original collection. -#### Binary Search Partitions - -- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md)`: Splits a collection into two partitions according to a predicate and returns the index of the partition. - ## Adding Swift Algorithms as a Dependency To use the `Algorithms` library in a SwiftPM project, From ea947a8f05c5eb11be934c3b08439ee856cb3c75 Mon Sep 17 00:00:00 2001 From: Pranav Kasetti Date: Wed, 28 Apr 2021 17:27:55 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: Nate Cook --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67b12337..d76b329c 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Read more about the package, and the intent behind it, in the [announcement on s - [`firstNonNil(_:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/FirstNonNil.md): Returns the first non-`nil` result from transforming a sequence's elements. - [`indexed()`](https://github.com/apple/swift-algorithms/blob/main/Guides/Indexed.md): Iterate over tuples of a collection's indices and elements. - [`interspersed(with:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Intersperse.md): Place a value between every two elements of a sequence. -- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md)`: Splits a collection into two partitions according to a predicate and returns the index of the partition. +- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md)`: Returns the starting index of the partition of a collection that matches a predicate. - [`reductions(_:)`, `reductions(_:_:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Reductions.md): Returns all the intermediate states of reducing the elements of a sequence or collection. - [`split(maxSplits:omittingEmptySubsequences:whereSeparator)`, `split(separator:maxSplits:omittingEmptySubsequences)`](https://github.com/apple/swift-algorithms/blob/main/Guides/LazySplit.md): Lazy versions of the Standard Library's eager operations that split sequences and collections into subsequences separated by the specified separator element. - [`windows(ofCount:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Windows.md): Breaks a collection into overlapping subsequences where elements are slices from the original collection. From 1261bd780b72030430d3f3ebe21939492829068d Mon Sep 17 00:00:00 2001 From: Pranav Kasetti Date: Mon, 3 May 2021 14:42:16 +0100 Subject: [PATCH 4/4] Update README.md Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d76b329c..614a1ec7 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Read more about the package, and the intent behind it, in the [announcement on s - [`firstNonNil(_:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/FirstNonNil.md): Returns the first non-`nil` result from transforming a sequence's elements. - [`indexed()`](https://github.com/apple/swift-algorithms/blob/main/Guides/Indexed.md): Iterate over tuples of a collection's indices and elements. - [`interspersed(with:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Intersperse.md): Place a value between every two elements of a sequence. -- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md)`: Returns the starting index of the partition of a collection that matches a predicate. +- [`partitioningIndex(where:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Partition.md): Returns the starting index of the partition of a collection that matches a predicate. - [`reductions(_:)`, `reductions(_:_:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Reductions.md): Returns all the intermediate states of reducing the elements of a sequence or collection. - [`split(maxSplits:omittingEmptySubsequences:whereSeparator)`, `split(separator:maxSplits:omittingEmptySubsequences)`](https://github.com/apple/swift-algorithms/blob/main/Guides/LazySplit.md): Lazy versions of the Standard Library's eager operations that split sequences and collections into subsequences separated by the specified separator element. - [`windows(ofCount:)`](https://github.com/apple/swift-algorithms/blob/main/Guides/Windows.md): Breaks a collection into overlapping subsequences where elements are slices from the original collection.