Skip to content

Fix time complexity documentation for insertion of Sequence into Heap #796

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

Closed
wants to merge 1 commit into from

Conversation

macbellingrath
Copy link
Contributor

Checklist

Description

The documentation of

insert<S: Sequence>(_ sequence: S) where S.Iterator.Element == T

states that the time complexity of this method is O(log n). This is not correct as it calls this method

insert(_ value: T) // time complexity of O(log n)

n times.

The overall complexity is thus O(n log n)

@macbellingrath macbellingrath changed the title Fix Time Complexity Documentation for insertion of Sequence into Heap Fix time complexity documentation for insertion of Sequence into Heap Oct 16, 2018
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.

1 participant