Skip to content

Conversation

@amarcjones
Copy link

No description provided.

5. `O(n + n + n + n)`
O(n)
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?

7. `O(1000 * n * log(n) + n)`
O(n * log(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.

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