This will help if you explain what the branching factor is:
The branching coefficient of a tree or graph is the number of children in each node.
So the answer seems to be mostly here:
http://www.scala-lang.org/docu/files/collections-api/collections_15.html
Vectors are represented as trees with a high branching coefficient. each tree node contains up to 32 vector elements or contains up to 32 other tree nodes. Vectors up to 32 elements long can be represented in one node. Vectors up to 32 * 32 = 1024 elements can be represented by one indirection. Two jumps from the tree root for a finite element node is enough for vectors with an accuracy of 2 15 three jumps for vectors with 2 20 four jumps for vectors with elements 2 25 and five jumps for vectors with elements up to 2 30 . Thus, for all vectors of a reasonable size, the choice of an element includes up to 5 elements of a primitive array. This is what we had in mind when we wrote that access to an element is "effective constant time."
So, basically, they had to make a design decision regarding how many children have to be on each node. As they explained, 32 seemed reasonable, but if you find it too restrictive for you, you can always write your own class.
For more information on why this could be 32, you can look at this article, since in the introduction they make the same statement as above that it is an almost constant time, but this article is about Clojure, more than Scala.
http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf
James black
source share