Is the binary tree list implementation scalable?

I am writing a simple codec. The tree will be precomputed and there will be no changes after its assembly. It will be just a search.

All leaf nodes of a balanced binary tree are signal values, and internal nodes are approximated compressed representations.

Is a list implementation using the stl vector scalable if I have a big value for leaf nodes? Currently, I do not know how big is big.

List implementation, for example. 1,2,3,4,5,6,7 if I have 4 leaf nodes

then the children

root(1)-> 2,3
2->4,5
3->6,7

so I can just go to the children using their position in the vector.

+2
source share
2 answers

"" "" ( ). O (log n) ( O (1) ).

vector, deque, . vector, , . , deque, , , - .

+4

( malloced ) MAX_ELEMENTS stl- , .

, stl- (, 32- )

L1. .

0

All Articles