2 ms·
We have to do arbitrary insertions/deletions from the middle, many of them. I think it is more like BTreeMap, but we need either sorting direction or rev(), and
by atemerev 1y ago
We have to do arbitrary insertions/deletions from the middle, many of them. I think it is more like BTreeMap, but we need either sorting direction or rev(), and there were some problems with both approaches I tried to solve, but eventually gave up.
- sunshowers 1y agoI see! The big issue I've run into with BTreeMap is that you can't provide an external comparator. If comparisons only require data that the keys already have, then the Reverse wrapper [1] has worked well for me. [1] https://doc.rust-lang.org/std/cmp/struct.Reverse.html https://doc.rust-lang.org/std/cmp/struct.Reverse.html