Need a custom red black tree data structure coded in Erlang with array like functions.

Închis Postat la acum 2 ani S-au achitat serviciile după ce au fost prestate
Închis S-au achitat serviciile după ce au fost prestate

I need a custom red black tree data structure coded in Erlang with array like functions.

Functions:

new(comparator function), returns a newly created custom rb tree that uses the comparator function passed in for comparisons

get(index), returns the tuple of key and value at index

get_kv_range(index1 inclusive, index2 noninclusive), returns list of key value tuples from index1 inclusive to either index2 noninclusive or until the end of the tree, whichever comes first

get_keys_range(index1 inclusive, index2 noninclusive), returns list of keys from index1 inclusive to either index2 noninclusive or until the end of the tree, whichever comes first

get_values_range(index1 inclusive, index2 noninclusive), returns list of values from index1 inclusive to either index2 noninclusive or until the end of the tree, whichever comes first

get(key), returns value of key

insert(key, value)

delete(key)

contains(key), true or false if key exists in tree

size(), returns number of keys in tree

index must be zero based.

all functions must be log(n) complexity

Erlang

ID Proiect: #32658340

Detalii despre proiect

Proiect la distanță Activ acum 2 ani