X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=blobdiff_plain;f=src%2Flib%2Fll.h;h=159aa4ca9a1e84a9a0652086b1204db19d220aa5;hp=f653825ffce1f8b75a3a255ffd2647b2fb748325;hb=48a59b737b260f4ae17210137c19486d1cc42eb3;hpb=eda37da84ccb4fc381507f04832d0358799ed67c diff --git a/src/lib/ll.h b/src/lib/ll.h index f653825f..159aa4ca 100755 --- a/src/lib/ll.h +++ b/src/lib/ll.h @@ -1,22 +1,38 @@ #ifndef __LL_H__ #define __LL_H__ #include +#include +#include #include "src/lib/16_tail.h" +//#define OTHERMERGELISTSTIFF + +/* Link list node_t */ typedef struct node { struct node *prev; rgb_t d; - int val; + int data; struct node *next; word id; } node_t; +#ifdef OTHERMERGELISTSTIFF +int listLength(node_t * item); void print_list(node_t * head); void pushe(node_t * head, int val); void pushs(node_t ** head, int val); int pop(node_t ** head); int remove_last(node_t * head); int remove_by_index(node_t ** head, int n); +#else +/* pull off the front node of the source and put it in dest */ +void Movenode(struct node** destRef, struct node** sourceRef); +struct node* SortedMerge(struct node* a, struct node* b); +struct node* LL_merge(struct node* a, struct node* b); +void pushll(struct node** head_ref, int new_data); +void printList(struct node *node); +void removeDuplicates(struct node* head); +#endif #endif