typedef struct fragment { int i, j, k; int ref; int score; struct fragment *bgf; } fragment; #define false 0 #define true 1 typedef char boolean; #define BitsInRandom 31 #define allowDuplicates #define MaxNumberOfLevels 16 #define UMaxNumberOfLevels 2 #define MaxLevel (MaxNumberOfLevels-1) #define UMaxLevel (UMaxNumberOfLevels-1) #define newNodeOfLevel(l) (node)malloc(sizeof(struct nodeStructure)+(l)*sizeof(node *)) typedef int keyType; typedef fragment* valueType; typedef struct nodeStructure *node; typedef struct nodeStructure { keyType key; valueType value; node forward[1]; } nodeStructure; typedef struct listStructure { int level; node update[MaxNumberOfLevels]; node header; } listStructure; typedef listStructure *list; typedef struct unodeStructure *unode; typedef struct unodeStructure { int key; unode link; } unodeStructure; typedef struct ulistStructure { unode header; } ulistStructure; typedef ulistStructure *ulist; list newList(); /* create a new list */ ulist unewList(); void reset_pos(); /* reset cur_p */ void freeList(); /* free the space of the list */ void uinsert(); /* insert a new node to the list */ int delete(); /* delete a node from the list by key */ boolean usearch(); /* search a node in the list by key */ valueType rsearch(); /* search a node in the list by key */ /* find p s.t. p->key < key <= (p->link)->key */ valueType rsearch_next(); /* search from cur_p */ /* find p s.t. p->key < key <= (p->link)->key */ keyType cur_key(); /* return the key of the node pointed by cur_p */ valueType next_val(); /* return the value of the node next to the node pointed by cur_p */ valueType snext(); void delete_next(); /* delete the node next to the node pointed by cur_p */ void update_node(); /* update the value of the node pointed by cur_p */ void insert_next(); /* insert a new node next to the node pointed by cur_p */