使用LC4实现Linked List.
Collaboration Requirements
You are not required to have a teammate. Points will not be deducted if you choose to work alone. If you would like to work as a team, you may only have one teammate. Groups of 3 or more are not permitted. You have 3 options for collaboration:
- No collaboration - complete the assignment independently. You do not need to create a README file.
- Collaboration and submit the same code - after each teammate completes their LinkedList functions, you are free to split up the remainder of the work as you see fit. You can work on everything together or each team member can work on part of the project. Both partners turn in the same code and will receive the same grade. You must include a README file detailing how you chose to divide up the work.
- Collaboration and submit different code - if you simply want to be able to discuss your code with a classmate, but prefer to work independently, you may have a teammate but each turn in your own work. You must still include a README with your teammate’s name and a brief summary of your collaboration process.
If you choose to work as a team, please follow these additional assignment requirements:
- Each team member must complete all 5 functions supporting the
LinkedList data structure independently. This is a core learning experience of the project and conquering it on your own will serve you well in your future work.
The remainder of the work - steps 2 through 5 below - may be split between you.
The entire file “lc4_memory.c” must be written by you alone as an individual project. - After you have completed the LinkedList file on your own, you may work with your partner to finalize a version of lc4_memory.c that will be used by your submitted program. You will likely find that you need to make changes to your “lc4_memory.c” file as a result of tests conducted by you and your partner. Implementing the LinkedList functions on your own is an invaluable learning experience, but once you have completed the functions, you are free to discuss them with your partner and refine the final version for submission.
- Each function must include a comment at the top with the name of the person who authored it. If there is anything more you think we should know about your submission, it should be included in your README file.
- Each team must submit a brief README file within Codio that describes your division of labor. If you are doing option 2, you need to include your teammate’s name and specify who wrote each function. If you are doing option 3, you need to include your teammate’s name and a brief (a few sentences max) description of how you worked together. The README should not be more than one page in length.
- Extra Credit: you may complete the extra credit portion independently or with your teammate. Your README file should indicate whether you attempted the extra credit alone or together. If you are turning in the same code but only your teammate worked on the extra credit, you should indicate that as well.
It is strongly recommended that you and your teammate work together to test, debug, and fix memory leaks in your code.
How to Submit
Whether you worked alone or with a teammate you should submit your code to Codio by marking your workspace complete. If applicable, you should complete your README file before submitting. The autograder will run upon submission, so it is very important that you have thoroughly tested your code and made sure that it compiles and contains no memory leaks before you submit. We will not be able to re-open your workspace or allow any modifications to your code after you submit. Submissions that contain memory leaks will not receive full credit. Submissions that don’t compile will receive very little, if any, credit.
Project Overview
This project involves the following high level steps:
- Create a pointer-based framework in C to hold a LinkedList by writing the following functions:
- a. A function to create a new node in the LinkedList. If this is the first node in the list, this function will create a new list. If there is already an identical node in the list, this function will update the contents of that pre-existing node.
- b. A function to search the LinkedList for a node with a specific memory address value.
- c. A function to search the LinkedList for a node with a specific opcode which has not yet been assigned an assembly instruction.
- d. A function to print the elements of the list in the specified format.
- e. A function to delete the entire list and free() the memory it was using.
- Write the open_file() function to open a .OBJ file specified by the user via the command line.
- Write the parse_file() function to extract information from the open file, place the information into your LinkedList, and close the file.
- Write the reverse_assemble() function to update each node in your LinkedList with the assembly language equivalent of the binary strings extracted by parse_file().
- Print your LinkedList. Debug and resolve memory leaks.
Tips for Collaboration
Here are some suggestions to discuss with your partner before starting. These are ideas that other students have found helpful but they are not required.
- Discuss your preferred communication platforms. Do you like to use Slack?
Email? Text messages? Regular video calls on Slack or Zoom? Pick something you will be able to check daily to help your collaborator with debugging challenges as they arise. - Most people appreciate updates about when you plan to work on the assignment.
Letting your teammate know that you plan to do most of your work over the weekend, for example, demonstrates a commitment to the work and helps set expectations for people with different working schedules. If you prefer to leave work until the last minute, your teammate deserves to know this (we recommend starting as early as possible). - Assign roles as soon as possible. It should be clear who is responsible for writing which sections of the code before you start the project. Consider writing the
README first (and updating it if necessary). - Review the assignment instructions and consider which parts you think will be the most challenging and which parts you feel the most confident in. Try to split up the work so that each person has at least one challenging section and one section they feel confident in. This allows each person to contribute their individual skills while also having opportunities to learn new things.
- Due to the size of the project, plan to check in multiple times.
- Plan at least one day to debug and fix memory leaks before turning in the assignment. While you will be primarily graded on functionality, it is important that you learn to use malloc() and free() correctly and that you learn to use Valgrind to find and eliminate any memory leaks. Code that contains memory leaks will not receive full credit.
- Whenever possible, try to explain your work to your teammate in your own words. Explaining your code to someone else is a great learning tool for both people!
- Back up your work to Codio frequently
- Before making changes to code your teammate has written, check in with them and discuss the change. You both may learn something by discussing their implementation.