emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[QZ#3] How to test Radix sort quiz #80

Closed TFloyd1989 closed 3 years ago

TFloyd1989 commented 3 years ago

I am not sure which method/ file we are supposed to use to test radix sort, when I use test robustness within sortquiztest, even the method Dr. Choi made does not pass the testrobustness test

TFloyd1989 commented 3 years ago

Specifically , LSDradixsort does not pass the testrobustness, and neither does my radixsortquiz

TFloyd1989 commented 3 years ago

This is what I get when I try to test LSDsort Screenshot (26)

marvinquiet commented 3 years ago

Hi, I checked Dr. Choi's code and it worked for me. Please make sure you did not change anything from Dr. Choi's repo.

image

TFloyd1989 commented 3 years ago

I made sure that they were exact copies(sorttest and sortquiztest) and testrobustness still does not work for any of the tests in sorttest

TFloyd1989 commented 3 years ago

Also, I notice in your code base that MSDradixsort does not throw an error, in our class we were never instructed to create that file

marvinquiet commented 3 years ago

I was creating this for testing other students' code because he wrote it under MSDRadixSort. Are you sure you also copied the correct LSDRadixSort? If possible, could you please push what you have to the Github and send me a link so that I can have a look at it.

TFloyd1989 commented 3 years ago

https://github.com/TFloyd1989/dsa-javaTFII I've pushed everything

TFloyd1989 commented 3 years ago

Within sorttest, I commented out the other tests and figured out that even selection sort failed the testrobustness

marvinquiet commented 3 years ago

Hi, I copied your code and run in my IDE, it successfully worked.

My suggestion would be restarting IDE because sometimes it may have some weird errors. Please also make sure that you run the correct testRobustness:

image

TFloyd1989 commented 3 years ago

Screenshot (27) I restarted my ide and I still got the same error. I am becoming increasingly worried because I think I may have gotten the radixsortquiz right, but I am unable to test it due to this error

TFloyd1989 commented 3 years ago

Do you have any recommendations to fix this? I'm very passionate about this course, but I'm just not sure how to get around this issue. I would hate to fail a quiz I could do but just couldn't test

lujiaying commented 3 years ago

Hi @TFloyd1989, please allow non-immediate response since it is on weekend not on weekdays. As TA, we are not expected to actively respond during weekend.

Back to the issue, I would suggest to keep your own implementations , and to delete all files that are copied from the textbook. Then re-do the copy process.

From the comment

Hi, I copied your code and run in my IDE, it successfully worked.

My suggestion would be restarting IDE because sometimes it may have some weird errors. Please also make sure that you run the correct testRobustness:

image

I doubt that some superclass files were accidentally modified.

TFloyd1989 commented 3 years ago

Thank you for your response, I do appreciate the help given that you are not obligated to respond. However, I have deleted and recopied the files multiple times, as well as updating my IDE and I'm still getting the same errors

TFloyd1989 commented 3 years ago

Screenshot (30) The specific problem is that the code in line 50 ( engine.sort(original);) does not invoke the sort method from the engine type. Instead, it does nothing, resulting in an unchanged array

TFloyd1989 commented 3 years ago

*line 54

marvinquiet commented 3 years ago

Hi, I cloned your repo and found the same error. And after replacing your script "BucketSort" and "RadixSort" with Dr. Choi's script, it could run.

So, please calm down and make sure that you copied all files correctly.

TFloyd1989 commented 3 years ago

Thank you for helping me solve these problems. I apologize for any inconvenience caused by my persistence in trying to get this problem solved, that's just how important this class is to me. I hope you both have a great rest of your weekend!

lujiaying commented 3 years ago

@TFloyd1989 thank you for putting efforts in this class. Hope you can learn a lot from it because algorithm is definitely one of the core concepts in computer science. And maybe the most useful one since it would be extremely examined during interviews.