Inserts a new key into the set.
Inserts a new key into the set.
the key to insert
true
if the key was new to the set,
false
if a node with the given key already existed
Finds the entry with the smallest key which is greater than or equal to the search key.
Finds the entry with the smallest key which is greater than or equal to the search key.
the search key
the found entry, or None
if there is no key greater than or equal
to the search key (e.g. the list is empty)
Searches for the Branch of a given key.
Searches for the Branch of a given key.
the key to search for
true
if the key is in the list, false
otherwise
Finds the entry with the largest key which is smaller than or equal to the search key.
Finds the entry with the largest key which is smaller than or equal to the search key.
the search key
the found entry, or None
if there is no key smaller than or equal
to the search key (e.g. the list is empty)
The number of levels in the skip list.
The number of levels in the skip list.
Finds the nearest item equal or greater than an unknown item from an isomorphic set.
Finds the nearest item equal or greater than an unknown item from an isomorphic set. The isomorphism is represented by a comparison function which guides the binary search.
a function that guides the search.
should return -1 if the argument is smaller
than the search key, 0 if both are equivalent,
or 1 if the argument is greater than the search key.
E.g., using some mapping, the function could look
like mapping.apply(_).compare(queryKey)
the nearest item, or the maximum item
The maximum gap within elements of each skip level.
The maximum gap within elements of each skip level.
The minimum gap within elements of each skip level.
The minimum gap within elements of each skip level.
The ordering used for the keys of this list.
The ordering used for the keys of this list.
Removes a key from the set.
Removes a key from the set.
the key to remove
true
if the key was found and removed, false
if it was not found
Reports the number of keys in the skip list (size of the bottom level).
Reports the number of keys in the skip list (size of the bottom level). This operation may take up to O(n) time, depending on the implementation.