The Beastie Forums
Where the Beastie Websites meet the World!

Home » The CS201 Forums » Programming Assignment 1 » Test #5 Failing for Unknown Reason
Test #5 Failing for Unknown Reason[message #7522] Wed, 22 February 2017 02:13 Go to next message
asvivian is currently offline asvivian
Understands Loops
Messages:12
Registered:August 2016
My code apparently failed Test #5 but there is no hint as to why.

The e-mail shows the test that was run up to the line "repeated 10000 times: insertDLL(a,X,v); and then on the next line simply says "the test did not succeed; it timed out" and nothing more. It then goes on to Test #6.

I at first assumed my dll object was to slow on inserts, but then I remembered that this is my same dll file from Assignment 0 which was fine. I tried testing on my own system for the speed of my dll file and by doing a similar test but instead of X (as I did not know what that meant), I used the midpoint of the list for the last 10,000 inserts as that has to be as bad as what it was tested on. It finished every time in under a second.

The timeout listed for Test #5 is 3 seconds if I'm reading correctly which I am well under. Could there be another issue? I'm not sure how to fix my code while unsure what the problem actually was.

Report message to a moderator

Re: Test #5 Failing for Unknown Reason[message #7523 is a reply to message #7522] Wed, 22 February 2017 15:36 Go to previous messageGo to next message
lusth is currently offline lusth
Guru
Messages:298
Registered:August 2013
For both your insert and remove, do you walk from the back if the index is towards the back?

Report message to a moderator

Re: Test #5 Failing for Unknown Reason[message #7526 is a reply to message #7523] Wed, 22 February 2017 17:23 Go to previous messageGo to next message
asvivian is currently offline asvivian
Understands Loops
Messages:12
Registered:August 2016
I do.

Report message to a moderator

Re: Test #5 Failing for Unknown Reason[message #7545 is a reply to message #7526] Fri, 24 February 2017 09:22 Go to previous messageGo to next message
lusth is currently offline lusth
Guru
Messages:298
Registered:August 2013
Are you sure, for both insert *and* remove?

Report message to a moderator

Re: Test #5 Failing for Unknown Reason[message #7552 is a reply to message #7545] Fri, 24 February 2017 16:25 Go to previous messageGo to next message
asvivian is currently offline asvivian
Understands Loops
Messages:12
Registered:August 2016
After looking a little more closely at my code, it would seem the remove function did not implement deletion properly from the back-end. Was that something being tested in Test #5? If so, that was most likely the reason for the time out.

Report message to a moderator

Re: Test #5 Failing for Unknown Reason[message #7570 is a reply to message #7552] Mon, 27 February 2017 13:33 Go to previous messageGo to next message
georgecoll is currently offline georgecoll
Understands Recursion
Messages:24
Registered:August 2016
I understand that walking from the back reduces time but how is walking from the front not also the same time constraints? If you know the distance from the back you also know distance from the front correct? Still Theta(1)?


Turn that frown upside down

Report message to a moderator

Re: Test #5 Failing for Unknown Reason[message #7571 is a reply to message #7570] Mon, 27 February 2017 14:20 Go to previous message
lusth is currently offline lusth
Guru
Messages:298
Registered:August 2013
^ The difference is, say, 5 from the back is n-5 from the front. One of those numbers is a constant, while the other is not.

Report message to a moderator

Previous Topic: Test 24
Next Topic: New version of Assignment #1
Goto Forum:
  


Current Time: Sun Apr 30 21:31:43 CDT 2017

Total time taken to generate the page: 0.00414 seconds