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

week 1, day 1 hw - big O exercises #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bigrobsf
Copy link

@bigrobsf bigrobsf commented Aug 1, 2017

No description provided.

Copy link
Contributor

@mmmaaatttttt mmmaaatttttt left a comment

Choose a reason for hiding this comment

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

part 2 looks great! part 1 requires one small adjustment.

4. `O(n^2 + n^3)` -> O(n^3)
5. `O(n + n + n + n)` -> O(n)
6. `O(1000 * log(n) + n)` -> O(n)
7. `O(1000 * n * log(n) + n)` -> 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.

careful with this one - which grows faster, n or nlog(n)?

Copy link
Author

Choose a reason for hiding this comment

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

ah, right. I overlooked the '*' between n and log(n)

5. `O(n + n + n + n)` -> O(n)
6. `O(1000 * log(n) + n)` -> O(n)
7. `O(1000 * n * log(n) + n)` -> O(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 more quickly than n^2, but we didn't talk about exponential growth in class so i wouldn't sweat this one too much.

Copy link
Author

Choose a reason for hiding this comment

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

... oh wow! I totally missed that.

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