Skip to content

Correct Chunked documentation #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 2, 2023
Merged

Conversation

mdznr
Copy link
Contributor

@mdznr mdznr commented Feb 3, 2022

  • Changed “same” to “equal” to clarify that this is an equality (Equatable, ==/!=) comparison, not identify comparison (===/!==).
  • Corrected algorithmic complexity documentation in Chunked.md
  • Added parameter documentation for belongInSameGroup and projection

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

@@ -96,7 +96,8 @@ collection conforms.

### Complexity

The eager methods are O(_n_), the lazy methods are O(_1_).
The eager methods are O(_n_) where _n_ is the number of elements in the
collection. The lazy methods are O(_n_) because the start index is pre-computed.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There definitely is a difference in complexity between the eager and lazy functions, but I’m finding it difficult to describe succinctly.

The eager functions are O(n) where n is the number of elements in the collection.

The lazy functions on the order of O(n) since the start index could require iterating to the very end of the collection. Each iteration of the receiving lazy sequence is also on the order of O(n), but total n where n is the number of elements in the collection—not n2.

@mdznr mdznr force-pushed the Chunked_Documentation branch 2 times, most recently from 36dc3d4 to f1e40c2 Compare February 3, 2022 21:06
@mdznr mdznr force-pushed the Chunked_Documentation branch from f1e40c2 to 392066c Compare February 3, 2022 21:10
Co-authored-by: Luciano Almeida <[email protected]>
@natecook1000 natecook1000 added this to the Swift Algorithms 1.1 milestone Jul 22, 2023
@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000 natecook1000 merged commit bfcaaa8 into apple:main Aug 2, 2023
@mdznr mdznr deleted the Chunked_Documentation branch August 2, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants