User Tools

Site Tools


haas:spring2014:data:projects:sll_rewrite

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:spring2014:data:projects:sll_rewrite [2014/02/21 22:38] – [Submitting] wedgehaas:spring2014:data:projects:sll_rewrite [2014/05/03 13:42] (current) – [03/22/2014] wedge
Line 86: Line 86:
 Note that, in order for these to compile successfully, the prerequisite node and list libraries must have been successfully compiled and library files stored in **lib/** Note that, in order for these to compile successfully, the prerequisite node and list libraries must have been successfully compiled and library files stored in **lib/**
  
 +=====A new way to look at lists=====
 +Unlike your previous implementation, where a list was more a loose collection of node pointers, we're going to do for lists what we did for nodes: make a list struct.
 +
 +<code c>
 +struct list {
 +    struct node *start;
 +    struct node *end;
 +    int qty;
 +};
 +</code>
 +
 +As you implement your list functions, you'll want to make use of the List pointer that is passed in, and be sure to maintain the correctness of **start**, **end**, and **qty** (qty is merely a count-- whenever you **insert()** or **append()**, qty should increase by 1; when you **getNode()**, it should go down by 1-- this will be quite useful in the coming projects).
 +
 +You'll also want to avoid reinventing the wheel-- rely on the other node/list functions to aid you in accomplishing the various tasks at hand (for example, you should have to do no further calls to **malloc()**-- the **mknode()** and **mklist()** functions should handle it).
 +
 +=====Task=====
 +Your task will be to correctly define all the listed functions (as prototyped in the various header files in the **inc/** subdirectory), so that the various unit tests in the **testing/** directory will function as intended.
 +
 +Look under the **src/** subdirectory, in **node/** and **list/**, and edit each file to implement the functions therein.
 =====Updating===== =====Updating=====
 Should any typos be identified and fixes released, or additional code included after you have obtained your original copy, you can synchronize your copy with the main version by doing the following: Should any typos be identified and fixes released, or additional code included after you have obtained your original copy, you can synchronize your copy with the main version by doing the following:
Line 94: Line 113:
  
 If there are any issued updates, you'll see output indicating them being applied. If any existing files are changed, a best effort is made to make backup copies, so risk of losing any work will hopefully be minimal (you should still be tracking this whole thing in version control just in case). If there are any issued updates, you'll see output indicating them being applied. If any existing files are changed, a best effort is made to make backup copies, so risk of losing any work will hopefully be minimal (you should still be tracking this whole thing in version control just in case).
 +
 +=====Errata=====
 +====05/03/2014====
 +  * Further tweaks:
 +    * Makefile updates
 +    * testing/unit-insert.c
 +    * testing/unit-append.c
 +    * testing/palindrome.c unused variable removed
 +    * some comment clean-up
 +
 +====03/22/2014====
 +  * Fixed a typo in **src/list/cp.c**
 +
 +====03/17/2014====
 +  * Updated Makefiles to support upgrading to **sll2** project
 +  * warning-free testing/nodetest.c should now be copied over
 +
 +====03/09/2014====
 +  * Added **testing/palindrome.c** for further list testing
 +  * Dropped connections may leave stale vi swap files laying about; Makefiles have been updated to remove any swapfiles that are present (unrelated to SLL1)
 +  * Added "make update" listing to main Makefile's help display
 +  * **testing/nodetest.c** compiled with a warning; resolved by changing out **%x** with **%p**
 +
 +====03/05/2014====
 +  * **src/list/pos.c:setpos()** had an incorrect return value; should be **<nowiki>Node *</nowiki>** (as prototyped in **inc/list.h**)
  
 =====Submission===== =====Submission=====
Line 103: Line 147:
   * Resulting libraries must be operational and functionally correct   * Resulting libraries must be operational and functionally correct
     * node and list functions must operate as described, conforming to provided function prototypes     * node and list functions must operate as described, conforming to provided function prototypes
 +    * code must make use of the other node/list functions as appropriate- do not reinvent the wheel
     * evaluations of libraries using various unit tests will be an assessment criteria     * evaluations of libraries using various unit tests will be an assessment criteria
   * Track/version the source code in a repository   * Track/version the source code in a repository
Line 125: Line 170:
 lab46:~/src/data/sll1$ make clean lab46:~/src/data/sll1$ make clean
 ... ...
-lab46:~/src/data/sll1$ make archive+lab46:~/src/data/sll1$ make save
 Archiving the project ... Archiving the project ...
 Compressing the archive ... Compressing the archive ...
haas/spring2014/data/projects/sll_rewrite.1393022299.txt.gz · Last modified: 2014/02/21 22:38 by wedge