Closed axkr closed 2 weeks ago
This question deserves careful thought and I'm busy with holiday stuff right now. The quick answer is that if you don't have duplicates, use the PersistentTreeSet or sortedSet() instead of an RRB-Tree.
Otherwise, your solution looks correct. That's the right place to start. We can try to improve efficiency later.
The quick answer is that if you don't have duplicates, use the PersistentTreeSet or sortedSet() instead of an RRB-Tree.
I have duplicates and another data structure is not an option.
Sorting a
MutRrbt
"inplace" is a very common process in my project. What is the "best practice" for sorting aMutRrbt
data structure (before making itimmutable()
)?Should something simple like the following snippet directly be included in
MutRrbt
or can this be done in a more "clever" way?