> Changing to a BTreeMap instead of a HashMap in the LRU cache to optimize memory usage.
Can someone explain to me how BTreeMap is more memory efficient than a HashMap?
Can someone explain to me how BTreeMap is more memory efficient than a HashMap?
Note that this explanation is a bit handwavy, as both data structures have numerous optimizations in production scenarios.
Rust's HashMap stores the collisions in the same table as the non-collisions (open addressing), not in a separate collection.