This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2015:data:projects:sll2 [2015/02/21 17:39] – [Errata] wedge | haas:spring2015:data:projects:sll2 [2015/03/10 12:28] (current) – [list library] wedge | ||
---|---|---|---|
Line 14: | Line 14: | ||
=====Objective===== | =====Objective===== | ||
- | In this project, we wrap up our singly-linked list implementation by exploring the reverse display and sorting of nodes in a list, along with writing a few application programs to see our list in action. | + | In this project, we complete the node transactions core of our singly-linked list implementation by exploring the remaining functions: **obtain()**, **clearlist()**, |
=====Project Overview===== | =====Project Overview===== | ||
Line 21: | Line 20: | ||
<code c> | <code c> | ||
- | List *obtain (List *, Node ** | + | List *obtain (List *, Node **); |
- | List *rmlist(List *); // | + | List *clearlist(List *); // empty an existing |
+ | List *rmlist(List *); // | ||
List *swapnode(List *, Node *, Node *); // swap positions of given nodes in list | List *swapnode(List *, Node *, Node *); // swap positions of given nodes in list | ||
- | List *sortlist(List *, int); // sort list (according to mode) | + | List *sortlist(List *, int); // sort list (according to mode) |
</ | </ | ||
====list library==== | ====list library==== | ||
- | In **src/ | + | In **src/ |
* **obtain.c** | * **obtain.c** | ||
- | * **rm.c** | + | |
+ | | ||
* **swap.c** | * **swap.c** | ||
* **sort.c** | * **sort.c** | ||
- | Take a look at the code there. These are the files that contain functions which will be compiled and archived into the node library (**liblist.a**) we will be using in this and future projects. | + | Take a look at the code there. These are the files that contain functions which will be compiled and archived into the list library (**liblist.a**) we will be using in this and future projects. |
Figure out what is going on, make sure you understand it. | Figure out what is going on, make sure you understand it. | ||
Line 43: | Line 44: | ||
* **unit-obtain.c** | * **unit-obtain.c** | ||
+ | * **unit-clearlist.c** | ||
* **unit-rmlist.c** | * **unit-rmlist.c** | ||
* **unit-swapnode.c** | * **unit-swapnode.c** | ||
Line 71: | Line 73: | ||
It is also highly recommended to undertake as it will give you further experience working with these concepts. | It is also highly recommended to undertake as it will give you further experience working with these concepts. | ||
+ | |||
+ | =====Expected Results===== | ||
+ | To assist you in verifying a correct implementation, | ||
+ | |||
+ | ====node library==== | ||
+ | Here is what you should get for the node library: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | ==================================================== | ||
+ | = Verifying Singly-Linked Node Functionality | ||
+ | ==================================================== | ||
+ | | ||
+ | | ||
+ | | ||
+ | ==================================================== | ||
+ | [RESULTS] Total: | ||
+ | ==================================================== | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | ====list library==== | ||
+ | Here is what you should get for all the functions completed so far in the list library (sll0+sll1+sll2): | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | ====================================================== | ||
+ | = | ||
+ | ====================================================== | ||
+ | [mklist] Total: | ||
+ | [insert] Total: | ||
+ | [displayf] Total: | ||
+ | [getpos] Total: | ||
+ | [setpos] Total: | ||
+ | [append] Total: | ||
+ | [searchlist] Total: | ||
+ | [cplist] Total: | ||
+ | [displayb] Total: | ||
+ | | ||
+ | [obtain] Total: | ||
+ | | ||
+ | [rmlist] Total: | ||
+ | [swapnode] Total: | ||
+ | [sortlist] Total: | ||
+ | ====================================================== | ||
+ | | ||
+ | ====================================================== | ||
+ | lab46: | ||
+ | </ | ||
=====Submission Criteria===== | =====Submission Criteria===== | ||
To be successful in this project, the following criteria must be met: | To be successful in this project, the following criteria must be met: | ||
* Project must be submit on time, by the posted deadline. | * Project must be submit on time, by the posted deadline. | ||
- | * The late submission window, if any, will be far shorter and once closed, will see no project evaluations done. | + | * Late submissions will lose 25% credit per day, with the submission window |
- | * Code must compile cleanly (no warnings or errors) | + | * All code must compile cleanly (no warnings or errors) |
* all requested functions must be implemented in the related library | * all requested functions must be implemented in the related library | ||
* all requested functionality must conform to stated requirements (either on this project page or in comment banner in source code files themselves). | * all requested functionality must conform to stated requirements (either on this project page or in comment banner in source code files themselves). | ||
Line 82: | Line 133: | ||
* output formatted, where applicable, must match that of project requirements | * output formatted, where applicable, must match that of project requirements | ||
* Processing must be correct based on input given and output requested | * Processing must be correct based on input given and output requested | ||
- | * Output must be correct | + | * Output, if applicable, |
* Code must be nicely and consistently indented (you may use the **indent** tool) | * Code must be nicely and consistently indented (you may use the **indent** tool) | ||
* Code must be commented | * Code must be commented | ||
* Any "to be implemented" | * Any "to be implemented" | ||
+ | * these "to be implemented" | ||
* Sufficient comments explaining the point of provided logic **MUST** be present | * Sufficient comments explaining the point of provided logic **MUST** be present | ||
+ | * Any and all functions written must have, **at most**, 1 **return** statement | ||
+ | * points will be lost for solutions containing multiple return statements in a function. | ||
* Track/ | * Track/ | ||
* Submit a copy of your source code to me using the **submit** tool (**make submit** will do this) by the deadline. | * Submit a copy of your source code to me using the **submit** tool (**make submit** will do this) by the deadline. |