| Computes the frequency (number of occurances, count) of each distinct value in the given sorted data.
After this call returns both distinctValues and frequencies have a new size (which is equal for both), which is the number of distinct values in the sorted data.
Distinct values are filled into distinctValues, starting at index 0.
The frequency of each distinct value is filled into frequencies, starting at index 0.
As a result, the smallest distinct value (and its frequency) can be found at index 0, the second smallest distinct value (and its frequency) at index 1, ..., the largest distinct value (and its frequency) at index distinctValues.size()-1.
Example:
elements = (5,6,6,7,8,8) --> distinctValues = (5,6,7,8), frequencies = (1,2,1,2)
Parameters: sortedData - the data; must be sorted ascending. Parameters: distinctValues - a list to be filled with the distinct values; can have any size. Parameters: frequencies - a list to be filled with the frequencies; can have any size; set this parameter to null to ignore it. |