Homework 2: Due Sep 24, 2008

September 10th, 2008

Here’s the PDF (the latex will be arriving shortly) and here’s the LaTeX

8 Responses to “Homework 2: Due Sep 24, 2008”

  1. Seth Says:

    Will you be posting the latex file?

  2. Mike Says:

    Is anyone else having a problem to get the code portion to run in the allotted time? I have the algorithm coded exactly how the book specifies, but can’t get it to work in the time limit. The one change I made is that I am using quick sort instead of merge sort because I was too lazy to write the merge sort code. Are there others using quick sort and having it work, or should I just bite the bullet and write merge sort?

  3. Mike Says:

    never mind. I got it working. Turned out to be some logic errors instead of a sorting issue (watch out for floating point numbers).

  4. Trilok Says:

    For the programming problem, I got the logic working (locally) for hard coded points. But I could not able to submit coz of the the input file issue. Is that the file name passed as the command line argument?
    Can I use new File(arg[0]) and read the content line by line and parse the line to numeric values?

  5. admin Says:

    you have to assume points come in on standard input, not from a file

  6. Adam Says:

    I might be missing something so I’d be happy to have someone point out my mistake, but it seems like the big-O in the second subproblem of 2.1 makes it impossible to get a big-Theta bound on the recursive running time. In other words, I think letting f(n) be constant, or letting it be n (log n)^2 result in two different big-Theta bounds even though both are possible since 1 = O(n(log n)^2.

    Thanks for any help.

  7. admin Says:

    you folks are too smart for me. I stand corrected. Please replace the big-O by Theta, so that there is indeed a unique answer for that question.

  8. Brian Matthews Says:

    UVa seems to be stuck on only telling me “Runtime error” I’ve tried everything I can think of, precision errors, floating point…, and nothing is getting accepted. I’ve tried the large dataset and pass it with flying colors. Does anyone have any hints, datasets so I could find my error?

Leave a Reply