User Tools

Site Tools


haas:summer2015:data:projects:sll1

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:summer2015:data:projects:sll1 [2015/05/31 12:10] wedgehaas:summer2015:data:projects:sll1 [2015/06/01 21:17] (current) – [list library (so far)] wedge
Line 30: Line 30:
 List *cplist(List *);                   // duplicate existing list List *cplist(List *);                   // duplicate existing list
 void displayb(List *, int);             // display list backwards void displayb(List *, int);             // display list backwards
-int compare(List *, List *);            // compare two lists for equality+uc compare(List *, List *, ulli *);     // compare two lists for equality 
 +</code> 
 + 
 +Additionally, the following content has been inserted, largely to aid with **compare()** implementation and operation: 
 + 
 +<code c> 
 +typedef struct list            List;    // because we deserve nice things 
 +typedef unsigned long long int ulli;    // short name for biggest space 
 +typedef unsigned char          uc;      // shorter name for smallest space 
 +</code> 
 + 
 +and:
  
 +<code c>
 +// return status codes
 +//
 +#define CMP_EQUALITY    0x00
 +#define CMP_L1_NULL     0x01
 +#define CMP_L1_EMPTY    0x02
 +#define CMP_L1_GREATER  0x04
 +#define CMP_L1_LESS     0x08
 +#define CMP_L2_NULL     0x10
 +#define CMP_L2_EMPTY    0x20
 +#define CMP_L2_GREATER  0x40
 +#define CMP_L2_LESS     0x80
 </code> </code>
  
Line 39: Line 62:
  
 In this project, **append()** can be considered that basic operation, where **cplist()** can be built using **append()** (along with any other list/node functions from this and previous projects). In this project, **append()** can be considered that basic operation, where **cplist()** can be built using **append()** (along with any other list/node functions from this and previous projects).
- 
 ====list library==== ====list library====
 In **src/list/**, you will find 5 new C files: In **src/list/**, you will find 5 new C files:
Line 83: Line 105:
 To assist you in verifying a correct implementation, a fully working implementation of the node library and list library (up to this point) should resemble the following: To assist you in verifying a correct implementation, a fully working implementation of the node library and list library (up to this point) should resemble the following:
  
-====node library==== 
-Here is what you should get for the node library: 
- 
-<cli> 
-lab46:~/src/data/sll1$ bin/verify-node.sh  
-==================================================== 
-=    Verifying Singly-Linked Node Functionality    = 
-==================================================== 
- [mknode] Total:   4, Matches:   4, Mismatches:   0 
- [cpnode] Total:   5, Matches:   5, Mismatches:   0 
- [rmnode] Total:   2, Matches:   2, Mismatches:   0 
-==================================================== 
-[RESULTS] Total:  11, Matches:  11, Mismatches:   0 
-==================================================== 
-lab46:~/src/data/sll1$  
-</cli> 
  
 ====list library (so far)==== ====list library (so far)====
Line 117: Line 123:
     [cplist] Total:  11, Matches:  11, Mismatches:   0     [cplist] Total:  11, Matches:  11, Mismatches:   0
   [displayb] Total:   6, Matches:   6, Mismatches:   0   [displayb] Total:   6, Matches:   6, Mismatches:   0
-   [compare] Total:   9, Matches:   9, Mismatches:   0+   [compare] Total:  15, Matches:  15, Mismatches:   0
 ====================================================== ======================================================
-   [RESULTS] Total:  85, Matches:  85, Mismatches:   0+   [RESULTS] Total:  91, Matches:  91, Mismatches:   0
 ====================================================== ======================================================
 lab46:~/src/data/sll1$  lab46:~/src/data/sll1$ 
haas/summer2015/data/projects/sll1.1433074245.txt.gz · Last modified: 2015/05/31 12:10 by wedge