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:42] – [Submission Criteria] 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 complete the node transactions core of our singly-linked list implementation by exploring the remaining functions: **obtain()**, | + | In this project, we complete the node transactions core of our singly-linked list implementation by exploring the remaining functions: **obtain()**, **clearlist()**, **rmlist()**, |
=====Project Overview===== | =====Project Overview===== | ||
Line 21: | Line 21: | ||
<code c> | <code c> | ||
List *obtain (List *, Node **); // obtain/ | List *obtain (List *, Node **); // obtain/ | ||
- | List *rmlist(List *); // | + | List *clearlist(List *); // empty an existing list |
+ | 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) | ||
Line 27: | Line 28: | ||
====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 42: | Line 44: | ||
* **unit-obtain.c** | * **unit-obtain.c** | ||
+ | * **unit-clearlist.c** | ||
* **unit-rmlist.c** | * **unit-rmlist.c** | ||
* **unit-swapnode.c** | * **unit-swapnode.c** | ||
Line 70: | 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: |