This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2015:data:projects:dlq0 [2015/04/18 13:50] – [In inc/queue.h] wedge | haas:spring2015:data:projects:dlq0 [2015/04/29 18:48] (current) – [Errata] wedge | ||
---|---|---|---|
Line 11: | Line 11: | ||
This section will document any updates applied to the project since original release: | This section will document any updates applied to the project since original release: | ||
- | * __revision | + | * __revision |
+ | * lacking a leading ' | ||
+ | * also, a few erroneous mentions of " | ||
+ | * __revision 2__: typo in unit-purge (20150427) | ||
+ | * " | ||
+ | * __revision 3__: typo in unit-dequeue (20150429) | ||
+ | * unit-dequeue was dequeueing backwards (FIXED) | ||
=====Objective===== | =====Objective===== | ||
Line 137: | Line 144: | ||
In object-oriented programming, | In object-oriented programming, | ||
- | ====list library==== | ||
- | One more enhancement is in store for our venerable **display()** function, and that is described below: | ||
- | |||
- | ===display() enhancements=== | ||
- | You are also to implement an additional feature (resulting in 8 additional modes) to the **display()** function. | ||
- | |||
- | This means you'll need to expand the current modulus divide by 8 to one of 16. | ||
- | |||
- | The current modes are as follows: | ||
- | |||
- | <code c> | ||
- | // | ||
- | // 1 display the list forward, with positional values | ||
- | // 2 display the list backwards, no positional values | ||
- | // 3 display the list backwards, with positional values | ||
- | // 4 display the list forward, no positional values, in ASCII | ||
- | // 5 display the list forward, with positional values, in ASCII | ||
- | // 6 display the list backwards, no positional values, in ASCII | ||
- | // 7 display the list backwards, with positional values, in ASCII | ||
- | </ | ||
- | |||
- | The new feature is to toggle the display of the individual arrows (and the terminating NULL value) and much of the natural spacing we've used so far. It should also ditch, when in ASCII mode, the quotes we have been placing around the ASCII characters. | ||
- | |||
- | The idea here is, when combined with the ASCII representation of the list, **display()** can become a pretty useful function for displaying strings, which could come in handy. | ||
- | |||
- | Also, when dealing with numeric values, we could make use of this in applications where we are handling the construction of a numeric value (such as a bignum). | ||
- | |||
- | For positioned displays, this would seem to have less utility, but by having a space displayed before the position value, we can salvage the output nicely. | ||
- | |||
- | So for each of the above 8 modes, you'll have a WITH_ARROWS mode, and then a WITHOUT_ARROWS mode (leaving us with a total of 16 possible combinations). | ||
- | |||
- | For sane implementation purposes, for our current 8 (so modes 0-7), those will be considered to be WITH_ARROWS... whereas the remaining 8 combinations (8-15) will be WITHOUT_ARROWS. All other mode features will map in place (if you recognize the binary pattern I've been following you'll hopefully see how trivial this change (and the previous one) will be). | ||
- | |||
- | Also, when not displaying arrows, no NULL values will be displayed at all; this means that in the event we are running **display()** on a NULL or empty list, nothing but a newline should be displayed. | ||
- | |||
- | ==display() output examples based on mode== | ||
- | Let's say we have a list with the following elements: | ||
- | |||
- | start -> 51 -> 49 -> 51 -> 51 -> 55 -> NULL | ||
- | |||
- | ==mode " | ||
- | <cli> | ||
- | 5149515155 | ||
- | </ | ||
- | |||
- | ==mode " | ||
- | <cli> | ||
- | [0]51 [1]49 [2]51 [3]51 [4]55 | ||
- | </ | ||
- | |||
- | ==mode " | ||
- | <cli> | ||
- | 31337 | ||
- | </ | ||
- | |||
- | ==mode " | ||
- | <cli> | ||
- | [0]3 [1]1 [2]3 [3]3 [4]7 | ||
- | </ | ||
====queue library==== | ====queue library==== | ||
Line 249: | Line 197: | ||
lab46: | lab46: | ||
</ | </ | ||
- | ====List Library unit tests==== | ||
- | As a result of the required changes to **display()**, | ||
- | Be sure to run the various list unit tests and verification scripts to see which functions have fallen out of compliance with the list struct specification changes issued in this project. The **verify-list.sh** script can be especially useful in getting a big picture view of what work is needed. | ||
====Queue library unit tests==== | ====Queue library unit tests==== | ||
In **testing/ | In **testing/ | ||
Line 281: | Line 226: | ||
=====Expected Results===== | =====Expected Results===== | ||
- | To assist you in verifying a correct implementation, | + | To assist you in verifying a correct implementation, |
- | + | ||
- | + | ||
- | ====list library==== | + | |
- | Here is what you should get for list: | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | ==================================================== | + | |
- | = Verifying Doubly-Linked List Functionality | + | |
- | ==================================================== | + | |
- | [mklist] Total: | + | |
- | [cplist] Total: | + | |
- | [rmlist] Total: | + | |
- | [append] Total: | + | |
- | [insert] Total: | + | |
- | [obtain] Total: | + | |
- | | + | |
- | [findnode] Total: | + | |
- | [sortlist] Total: | + | |
- | [swapnode] Total: | + | |
- | ==================================================== | + | |
- | | + | |
- | ==================================================== | + | |
- | lab46: | + | |
- | </ | + | |
- | With the added feature to **display()**, | ||
- | But aside from this change to **display()**, | ||
====queue library==== | ====queue library==== | ||
Line 317: | Line 235: | ||
<cli> | <cli> | ||
lab46: | lab46: | ||
- | =================================================== | + | coming soon... |
- | = | + | |
- | =================================================== | + | |
- | [mkqueue] Total: | + | |
- | [cpqueue] Total: | + | |
- | [rmqueue] Total: | + | |
- | [purge] Total: | + | |
- | [enqueue] Total: | + | |
- | [dequeue] Total: | + | |
- | =================================================== | + | |
- | [RESULTS] Total: | + | |
- | =================================================== | + | |
lab46: | lab46: | ||
</ | </ |