Frequency of statistical distribution is the array ai with the length m + 1, where m - the length of interval array ar2. Where:
a1. The number of elements of the data array ar1 at the interval (-∞, ar2[1]].
ai. The number of elements of the data array ar1 at the interval (ar2[i - 1], ar2[i]].
am + 1. The number of elements of the data array ar1 at the interval (ar2[m, +∞].
Binary search algorithm is used to find corresponding interval for each element in the data array ar1.
If the data array is empty, an array of zeroes is returned. When the interval array is empty, and array containing a single element is returned; the element is equal to the number of elements in the data array.
See also: