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

Imefungwa Ilichapishwa Miaka 2 iliyopita Kulipwa wakati wa kujifungua
Imefungwa Kulipwa wakati wa kujifungua

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

Kitambulisho cha Mradi: #32658340

Kuhusu mradi

Mradi wa mbali Ipo mtandaoni %project.latestActivity_relativeTime|badilisha%