{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
Assignment 4: Algorithms, Counting, Complexity, and Interfaces ANSWER KEY CSci 1001, Spring 2010 7 April 2010 1 General Comments Who Graded What: If you have questions on any of the solutions here, or general grading questions, feel free to see any of the course teachers or TAs. If you think we missed something and that the grading is incorrect, please ask the grader for a regrade within a week of the day the homework is returned . Here’s who graded what on this assignment: Problem 1: Jonathan Lawson Problem 2: Faraz Mohammad-Mirzaei Problem 3: Katie Panciera Problem 4: Tyler Smith A few general comments: If you didn’t do well (or didn’t do as well as you had hoped) on this assignment, please (i) look over this key, and try to understand well what you did wrong, (ii) look over the file, on the course web page, of tips for doing well in this class, (iii) make use of office hours. Please read the problems carefully and make sure you understand what they are asking. Some people lost points because they answered the wrong question. If you have any question about what a problem is asking for, please ask about it. Please staple your pages together and write the problems in order to make sure that we don’t miss any problems. 1
Image of page 1

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

View Full Document Right Arrow Icon
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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern