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?
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?
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.
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?
September 16th, 2008 at 3:33 pm
Will you be posting the latex file?
September 16th, 2008 at 4:36 pm
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?
September 16th, 2008 at 10:34 pm
never mind. I got it working. Turned out to be some logic errors instead of a sorting issue (watch out for floating point numbers).
September 18th, 2008 at 2:48 pm
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?
September 18th, 2008 at 2:50 pm
you have to assume points come in on standard input, not from a file
September 19th, 2008 at 10:16 am
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.
September 19th, 2008 at 10:17 am
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.
September 24th, 2008 at 4:01 pm
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?