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:43] – [list testing applications] 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 92: | Line 95: | ||
====list library==== | ====list library==== | ||
- | Here is what you should get for all the functions completed so far in the list library (sll0+sll1): | + | Here is what you should get for all the functions completed so far in the list library (sll0+sll1+sll2): |
<cli> | <cli> | ||
Line 105: | Line 108: | ||
[setpos] Total: | [setpos] Total: | ||
[append] Total: | [append] Total: | ||
- | [displayb] Total: | ||
[searchlist] Total: | [searchlist] Total: | ||
[cplist] Total: | [cplist] Total: | ||
+ | [displayb] Total: | ||
+ | | ||
+ | [obtain] Total: | ||
+ | | ||
+ | [rmlist] Total: | ||
+ | [swapnode] Total: | ||
+ | [sortlist] Total: | ||
====================================================== | ====================================================== | ||
- | | + | |
====================================================== | ====================================================== | ||
lab46: | lab46: |