Skip to content

Conversation

@kevincchang13
Copy link

Can someone check if I did this right? Thanks!

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.

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

7. `O(1000 * n * log(n) + n)`
O(n*log(n))

8. `O(2^n + 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 we didn't cover this in class so I wouldn't sweat this one too much.

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.

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