-
Notifications
You must be signed in to change notification settings - Fork 140
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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)
?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.