sli_removet

March 26, 2020 Contributors

Name

sli_remove — Remove a node by key

Synopsis

#include "skiplist.h"

| int **sli_remove** ( | sl, |   |
|   | m, |   |
|   | myfree); |   |

Skiplist * <var class="pdparam">sl</var>;
skiplistnode * <var class="pdparam">m</var>;
FreeFunc <var class="pdparam">myfree</var>;

Description

This function is similar to sl_remove, but you pass in the node that you wish to remove. Any clones will also be removed.

Parameters

sl

The Skiplist.

m

The node that you wish to remove.

myfree

This is the optional, user-defined function that frees a data element in the skiplist. It is defined as: typedef void (*FreeFunc) (void *);

Return Value

On success this function returns the height of the resulting skiplist or 0 on error.

Threading

It is legal to call this function in any thread but skiplist functions are not thread safe.

See Also

“Skiplist”