What goes in the blank?
# recursive segment tree over n leaves (root = 1, # children 2k and 2k+1): a safe array size tree = [0] * (____ * n)
Answer: 4
For n that is not a power of two the tree is deeper than log2(n), and indexes can exceed 2n; 4n always fits.
Play Problem Solving ▸