{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

a04-key

# a04-key - Assignment 4 Algorithms Counting Complexity and...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
By showing your work, you are more likely to get partial credit. Since we specified in the directions that you had to show your work, not showing your work often lost you points. We tried to only deduct points once for a prior problem. So if you made a mistake in part b and part c depended on part b, as long as your part c used part b correctly you got full credit. Note that this does not mean that part c was correct, simply that we didn’t want you to be penalized multiple times for early mistakes. 2 Writing Good Algorithms Problem 1.1 [5 points] No, the algorithm is not correct. Instead of adding up 5 + 10 + 15 + . . . + 100, you get 1 + 6 + 11 + . . . + 96. So depending how you think about it, it doesn’t do what’s intended OR it doesn’t do what’s intended correctly. To fix it, we can change the beginning value of x from 1 to 5 or 0.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern