How does Scala's Vector work?

Viewed 6639

I read this page about the time complexity of Scala collections. As it says, Vector's complexity is eC for all operations.

It made me wonder what Vector is. I read the document and it says:

Because vectors strike a good balance between fast random selections and fast random functional updates, they are currently the default implementation of immutable indexed sequences. It is backed by a little endian bit-mapped vector trie with a branching factor of 32. Locality is very good, but not contiguous, which is good for very large sequences.

As with everything else about Scala, it's pretty vague. How actually does Vector work?

3 Answers
Related