Lines Matching refs:element
101 * \brief Create a new skip list element.
103 static errval_t new_node(struct skip_node** sn, void* element, size_t level)
118 (*sn)->element = element;
156 printf("%s", cur->element);
166 * \brief Checks if a element is in the list.
169 * \param elem The element to find.
180 while(cur->forward[i] != NULL && strcmp(cur->forward[i]->element, elem) < 0) {
187 if (cur != NULL && strcmp(cur->element, elem) == 0) {
195 * \brief Insert element in list.
201 * \param to_insert The element we'd like to insert.
209 // Find element in table and save previous pointer which
212 while(cur->forward[i] != NULL && strcmp(cur->forward[i]->element, to_insert) < 0) {
220 if(cur == NULL || strcmp(cur->element, to_insert) != 0) {
246 * \brief Remoeves an element for the skip list.
248 * \param ss List to search for the element.
249 * \param to_delete The element to remove.
256 while(cur->forward[i] != NULL && strcmp(cur->forward[i]->element, to_delete) < 0) {
263 if(strcmp(cur->element, to_delete) == 0) {
270 char* to_return = cur->element;
282 return NULL; // element not found
300 * computation. Otherwise provide the last returned element
323 to_intersect = state[0]->forward[0]->element;
331 while(cur->forward[k] != NULL && strcmp(cur->forward[k]->element, to_intersect) < 0) {
341 else if (strcmp(cur->element, to_intersect) != 0) {
342 // no match, continue with next element