... given two structures , containing the data on the left and right sons, and that returns the data in the current top struct data { int sum, pref, suff, ans; }; data combine (data l, data r) { data ... powerful data structure, for example, the Cartesian tree 48 Segment tree while preserving the history of its values (better to persistent -data structure) Persistent -data structure called such a data ... such a data structure It should be noted immediately clear analogy trees segments of this type with two-dimensional data structures (in fact, in a sense, this is a two-dimensional data structure, ...