Skip to content

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


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