With , it suffices to put the threshold between and for . Form the prefix sums
They take operations to compute. The minimized squared errors for the two children are
and
Each candidate value therefore takes constant time once the prefix sums are available. Scanning all candidates takes operations in the sense of Big O notation, and retaining the minimizing gives the optimal split.

Articles by others on the same topic (0)

There are currently no matching articles.