hello again, i have trouble understanding this text from the docs:
A B-Tree instead makes each node contain B-1 to 2B-1 elements in a contiguous array. By doing this, we reduce the number of allocations by a factor of B, and improve cache efficiency in searches. [...]
what's "element B-1" or "element 2B-1" referring to here?
Note that B-Trees are not binary trees, though still binary search trees. They are a different type of tree where each node can contain more than one element, and more than two children (as opposed to binary trees where each node can contain only one element and at most two children).B is the branching factor of the B-Tree, that is the starting number used to calculate how many elements and children one node can have at most. For the stdlib's BTreeMap it is undocumented, but it's currently 6. "B-1 to 2B-1 elements" means that each node contains at least B-1 elements and at most 2B-1 elements.