May 2019
Intermediate to advanced
698 pages
17h 21m
English
As shown in this section, maps and sets have a lot in common and there are two ways that the Rust collections library provides them. HashMap and HashSet use a smart approach to finding and inserting values into buckets called Robin Hood hashing. Recalling the comparison benchmarks from Chapter 16, Exploring Maps and Sets, it provided a more stable and significantly better performance over a naive implementation:

BTreeMap and BTreeSet are based on a different, more efficient implementation of a B-Tree. How much more efficient (and effective)? Let's find out!
For a naive implementation of a B-Tree (from Chapter 15, Robust Trees), the ...
Read now
Unlock full access