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

Example of a complexity calculation in lecture 9 #16

Open
JensRyeNielsen opened this issue May 15, 2020 · 1 comment
Open

Example of a complexity calculation in lecture 9 #16

JensRyeNielsen opened this issue May 15, 2020 · 1 comment

Comments

@JensRyeNielsen
Copy link

Hej Jeppe

I am a bit confused about your example 2.3 in lecture 9. You calculate the total number of operations to
3n^2+6n+4.
But as i understand the reasoning behind number of operations shouldn't the total number of operations be
6n^2+5n+4
as 1) loop over n*n combinations with 3 assignments and 3 multiplications gives 6n^2 operations 2) loop over n combinations with 2 assignments, 2 multiplications and 1 addition gives 5n?

In advance, many thanks for the help!

Best
Jens

@JeppeDruedahl
Copy link
Contributor

You are correct. I can apparently not count.

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

No branches or pull requests

2 participants