Skip to content
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

Consistent big O notation in map.rs #90239

Merged
merged 1 commit into from
Oct 27, 2021
Merged

Consistent big O notation in map.rs #90239

merged 1 commit into from
Oct 27, 2021

Conversation

wooster0
Copy link
Contributor

Follow up to #89216

@rust-highfive
Copy link
Collaborator

r? @yaahc

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 24, 2021
@wooster0
Copy link
Contributor Author

Now that I look at it closer, isn't there an 'O' missing here in https://github.com/rust-lang/rust/blob/master/library/alloc/src/collections/btree/map.rs#L39 for (log2n)? In that case I could fix that up in this PR too.

@fee1-dead
Copy link
Member

fee1-dead commented Oct 27, 2021

Was this supposed to be big O? I think expressing it like "B * log(n) comparisons" is fine.

Also, the line you linked is correct.

a perfectly balanced BST performs the theoretical minimum amount of comparisons necessary to find an element (log2n).

@wooster0
Copy link
Contributor Author

@fee1-dead Alright, that's cleared up then! I removed the big O notation.

@fee1-dead
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 27, 2021

📌 Commit b1b4c6c has been approved by fee1-dead

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 27, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 27, 2021
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#90239 (Consistent big O notation in map.rs)
 - rust-lang#90267 (fix: inner attribute followed by outer attribute causing ICE)
 - rust-lang#90288 (Add hint for people missing `TryFrom`, `TryInto`, `FromIterator` import pre-2021)
 - rust-lang#90304 (Add regression test for rust-lang#75961)
 - rust-lang#90344 (Add tracking issue number to const_cstr_unchecked)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 088dc91 into rust-lang:master Oct 27, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 27, 2021
@bors
Copy link
Contributor

bors commented Oct 27, 2021

⌛ Testing commit b1b4c6c with merge 4e0d397...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants