arunbear / Tree-RB

Perl 5 implementation of Red Black Trees
https://metacpan.org/pod/Tree::RB
Other
2 stars 0 forks source link

all keys are treated as strings? #1

Closed deltazita closed 1 year ago

deltazita commented 1 year ago

I created a RBT with numbers as keys and min/max functions do not work well For example, 'min' considers 7094 < 710 Apologies, I just saw that you can define your own comparator

arunbear commented 1 year ago

Yes, because the tree allows values to be anything, so lexical ordering by default seemed like the sensible thing to do.