-
Notifications
You must be signed in to change notification settings - Fork 25
sort #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
sort #40
Conversation
|
I'll be code reviewing this |
|
I'll be code reviewing this as well |
|
I'll be code reviewing this |
|
Verification Hey Enrico! Looking at what you put for your issue and comparing to your pull request. Mostly everything said was implemented (besides the -n but you did the other two so I personally don't think it's too bad). The functionality of sort as well of the flags are really good! The only issue was starting up the qemu. Because you also added in strace, and other aspects from lab, I needed to chmod +x generate-traces.sh as before I would get permission denied. Other than this hiccup, everything compiled and worked. Testing For testing I tried a various amounts of versions of moving flags around. When it came to testing I didn't find any bugs. The test cases you provided were very good and represented a lot of cases. I went ahead and tried more combinations to the text files such as putting an empty space, capitalization, and the same words with various capitalization and it works as well! Overall your code seems to cover a good base of edge cases and inputs! Also I tried to throw the flags around in different cases such as 'sort test.txt -r -u' and 'sort -u -r test.txt' and the code does recognize these flags and they work so awesome! Code Walkthrough Your code is clear and with your comments you put, it's fairly easy to see what's happening with our code and data that we put in. I did note you did bubble sort which can either be the fastest or slowest sorting algorithm so as a possible refactor, we could implement a different algorithm based on the size of the file? Perhaps if it's a small file with 3 lines, then let's execute bubble sort, but now if we do reach our max lines of 256, maybe we could instead sort by doing merge/quick sort? Besides this small possible change, everything looks good and works just as well! High Level Checks: Code Checks: |
Great job!! Everything works as intended!VerificationOverall, your implementation works as expected! But according to your issue description #18, you included TestingI ran all the tests you provided and some additional ones as well including empty, single-lined, already sorted, mixed characters, and duplicate files produced the expected results. The Your error handling is implemented well! For example, when trying to open a non-existent file, it returns: Code WalkthroughA few notes:
Once again, great job! High Level Checks:
Code Checks:
|
VerificationHey! Looking at your implementation, you've successfully implemented both the sort utility and system call tracing functionality. The sort command works exactly as specified with the TestingI tested your sort implementation with various combinations of flags and inputs:
Your test cases cover a good range of scenarios and the implementation handles edge cases well! Code WalkthroughYour code is well-structured and easy to follow: Sort Implementation:
Strace Implementation:
Minor Suggestions:
High Level Checks
Code Checks
Final AssessmentGreat job! Your implementation is solid and meets all the requirements. The code is clean, well-documented, and handles edge cases appropriately. The strace implementation is particularly impressive with its comprehensive approach and excellent documentation. Recommendation: ✅ APPROVE The only minor suggestions are about variable naming and potential future optimizations, but these don't affect the functionality or quality of your current implementation. Everything works as intended! |
Nice, even checked over Lab 3 for me! 🙏 |
|
Uh oh, looks like you are using this repo for your labs. Those should be checked into your private repo. This sort implementation looks good. I have nothing against bubble sort here. However, one big limitation is the fixed-size array, which is very small for both lines and line lengths. This needs to dynamically allocate both (using I'd write a a couple of helper functions to do this, but the basic idea would be to copy what Java's ArrayList does and double the size of the allocation each time you need more space (and then The getline example we used in the last lab is pretty close to being functional for this, although we'd need to modify it a bit to work in this situation. 4.5/5 +0.5 -> dynamic sizes for lines / line lengths |
sortis a command to sort lines of text in alphabetical order.How to use:
sort ./example.txt (flags)
Flags:
-u: only list unique entries
-r: reverse list
Tests for my project:
tests/test1.txt
tests/test2.txt
tests/test3.txt
tests/test4.txt