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

Big O exercise #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Big O exercise #26

wants to merge 1 commit into from

Conversation

amarcjones
Copy link

No description provided.

6. `O(1000 * log(n) + n)`
O(log(n))
Copy link
Contributor

Choose a reason for hiding this comment

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

double check this one - which grows faster, log(n) or n?

8. `O(2^n + n^2)`
O(n^2)
Copy link
Contributor

Choose a reason for hiding this comment

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

2^n grows faster than n^2, but i wouldn't sweat this one too much since we didn't talk about exponential growth in class.

@@ -36,6 +48,8 @@ function logAtMost10(n) {
console.log(i);
}
}
Time: O(n)
Copy link
Contributor

Choose a reason for hiding this comment

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

double check your time complexity here. What's the largest number of operations that will be performed?

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.

2 participants