Closed sherr-an closed 3 years ago
Hi,
I just tested your code. Taking the simplest case, the prefix is "she", your output is
[she, shea, shed, shee, shel, shem, shen, sher, shes, shew, shear, sheas, sheat, sheaf, sheal, shean, sheds, shedu, sheep, sheer];
As you can tell by eye, when it becomes to 5 characters, it is not ordered by alphabet. This is a major logic problem and I am not sure when you test it, did you find this problem..
Wenjing
Also, it seems that your code does not handle empty string or whitespaces.
Hi,
I just tested your code. Taking the simplest case, the prefix is "she", your output is
[she, shea, shed, shee, shel, shem, shen, sher, shes, shew, shear, sheas, sheat, sheaf, sheal, shean, sheds, shedu, sheep, sheer];
As you can tell by eye, when it becomes to 5 characters, it is not ordered by alphabet. This is a major logic problem and I am not sure when you test it, did you find this problem..
Wenjing
Thank you for the help! I did not notice the problem when testing... As for empty string, I thought we should return an empty list and intentionally designed it... Sorry
You still have time refining it and I think for alphabetical order, you an modify it within two lines
You still have time refining it and I think for alphabetical order, you an modify it within two lines
Thank you. I have pushed one line of code to sort, although I do not feel very positive that it will help me pass a lot more tests, as I believe the problem comes from my logic mistake with not sorting the map. I will greatly appreciate it if you could retest my code. Besides, I actually attempted the extra credit but unfortunately made a mistake by creating another java file for the new data type. I have moved it under the correct java file, and it would be great if you can test it as well. Sorry and I am only hoping that the ec could boost me into a decent grade...Thanks a lot.
I think yes, by sorting the map you will get some test cases correct.
I tried to put your Freq.java into the class and tried to test extra, but you may need to know that your extra should also first pass the basic cases and then do your frequencies.
I think yes, by sorting the map you will get some test cases correct.
I tried to put your Freq.java into the class and tried to test extra, but you may need to know that your extra should also first pass the basic cases and then do your frequencies.
Thanks for the information. I think I found a way to sort the map in one line and I updated the files!
Hi, I know that sounds silly, but I do not understand why I am not passing the homework tests and barely getting any points... There might be a key in the homework requirement that I misunderstood (and still do not get), because my submission passed my own tests well. Could you help me take a look at my repository? Thank you.