This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2015:data:projects:dll2 [2015/11/08 11:23] – [list.h] wedge | haas:fall2015:data:projects:dll2 [2015/11/08 13:34] (current) – [list library] wedge | ||
---|---|---|---|
Line 36: | Line 36: | ||
To implement **qty**, all list functions that perform manipulations to the list will need to see some updating (**mklist()**, | To implement **qty**, all list functions that perform manipulations to the list will need to see some updating (**mklist()**, | ||
+ | |||
+ | ====list library==== | ||
+ | Again, in **src/ | ||
+ | |||
+ | ===display() enhancements=== | ||
+ | You are also to implement 4 additional modes to the display() function. | ||
+ | |||
+ | Be sure to adjust any mode error correction accordingly. | ||
+ | |||
+ | The modes are as follows: | ||
+ | |||
+ | <code c> | ||
+ | ////////////////////////////////////////////////////////////////////// | ||
+ | // | ||
+ | // Options for list display() and support catlist() functions | ||
+ | // | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | What has changed? There are two additional toggles: | ||
+ | * NOASCII/ | ||
+ | * in ASCII mode, separators become commas, and the terminating NULL no longer is output | ||
+ | * SEPS/NOSEPS - whether or not to display arrows/ | ||
+ | |||
+ | For example, if there was a numeric 65 stored in the node, with DISPLAY_ASCII set, an **' | ||
+ | |||
+ | ==display() output examples based on mode== | ||
+ | Let's say we have a list with the following elements: | ||
+ | |||
+ | first -> 51 -> 49 -> 51 -> 51 -> 55 -> NULL | ||
+ | |||
+ | ==forward, no positions, with separators, as numbers (not ASCII)== | ||
+ | <cli> | ||
+ | 51 -> 49 -> 51 -> 51 -> 55 -> NULL | ||
+ | </ | ||
+ | |||
+ | ==forward, with positions, with separators, as numbers (NOT ASCII)== | ||
+ | <cli> | ||
+ | [0] 51 -> [1] 49 -> [2] 51 -> [3] 51 -> [4] 55 -> NULL | ||
+ | </ | ||
+ | |||
+ | ==forward, no positions, with separators, in ASCII== | ||
+ | <cli> | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | ==forward, with positions, with separators, in ASCII== | ||
+ | <cli> | ||
+ | [0] ' | ||
+ | </ | ||
+ | |||
+ | ==forward, no positions, no separators, in ASCII== | ||
+ | <cli> | ||
+ | 31337 | ||
+ | </ | ||
+ | |||
+ | Please see the unit test for more information. | ||
====List library applications==== | ====List library applications==== | ||
Line 45: | Line 109: | ||
But we've not done anything to address the presence of cycles. Here we will explore how to detect them, and even attempt to ascertain where they start (source) and at what point the list repeats (destination) over and over again. | But we've not done anything to address the presence of cycles. Here we will explore how to detect them, and even attempt to ascertain where they start (source) and at what point the list repeats (destination) over and over again. | ||
- | |||
- | |||
=====Expected Results===== | =====Expected Results===== | ||
To assist you in verifying a correct implementation, | To assist you in verifying a correct implementation, |